Skip to content

Conversation

@tzstoyanov
Copy link

@tzstoyanov tzstoyanov commented Nov 20, 2025

This patch updates the project to the current version of the SDK. It adds support for rp2350 and uses the flash size as set by the SDKs board file.


Based on @MelanieT's PR #5 with a few additional changes:

  • Addressed @JZimnol comments .
  • Re-based on latest main branch.
  • Allow more flexible way for defining FOTA user options.
  • Updated for Mbed TLS 3.x

Tested on PicoW / RP2040.
Tested on Pico2 W / RP2350.

MelanieT and others added 5 commits November 9, 2025 19:40
Tzvetomir Stoyanov:
 - Use SDK defines to check for PICO platform in the C code.
Usually FOTA is used as an external library to a project. There are
a few compile time options, that the user of the library can tweak
depending on the use case. Currently these can be changed only by
modifying the FOTA CMake file. Allowing user to define these options in
its CMake files simplifies the FOTA library integration.
In Mbed TLS 3.x and later, some functions are renamed to match the new
API conventions. Added compatibility check and defines to handle both
old and new versions of the API.
@tzstoyanov
Copy link
Author

fixes #8

Copy link
Owner

@JZimnol JZimnol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Please update also README's "Prerequisites" section and memory layout.

First round of review done. Unfortunately I cannot test it on pico2w as I don't have any.

CMakeLists.txt Outdated
Comment on lines 119 to 123
if(${PICO_PLATFORM} STREQUAL "rp2350-arm-s")
set(CPU "2350")
else()
set(CPU "2040")
endif()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think when you use PARENT_SCOPE in the same if above, you don't have to repeat it here.
Like:

if(${PICO_PLATFORM} STREQUAL "rp2350-arm-s")
    set(CPU "2350" PARENT_SCOPE)
else()
    set(CPU "2040" PARENT_SCOPE)
endif()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed setting CPU in the function and made the other one with global scope.

#include <pico/stdlib.h>

#include <pico_fota_bootloader/core.h>
#include <stdlib.h>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<pico/stdlib.h> is already included above

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pico/stdlib.h is not the same as stdlib.h. I don't know if it's still needed but during development I needed something from the "real" stdlib.h

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build passes without #include <stdlib.h>, I've removed it.

@JZimnol JZimnol linked an issue Nov 23, 2025 that may be closed by this pull request
Updated documentation with latest changes:
 - Support for Pico2 W.
 - File system block reservation.
@tzstoyanov tzstoyanov requested a review from JZimnol November 25, 2025 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Pico2 W

3 participants