8000 ports/zephyr: Update to Zephyr 3.3.0. · micropython/micropython@8a3252d · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a3252d

Browse files
committed
ports/zephyr: Update to Zephyr 3.3.0.
This commit updates the Zephyr port with the changes listed in https://docs.zephyrproject.org/3.2.0/releases/release-notes-3.2.html, specifically: - Changed `#include <zephyr/zephyr.h>` to `#include <zephyr/kernel.h>`. - Changed `FLASH_AREA_LABEL_EXISTS(storage)` to `FIXED_PARTITION_EXISTS(storage)`. Only minimal testing was done using a Nordic nRF5340-DK board (`nrf5340dk_nrf5340_cpuapp`): compile, flash, run some simple Python code), but the changes are cosmetic, not functional. The commit was also tested to work with the recent Zephyr 3.3.0 release.
1 parent 8d9a7fd commit 8a3252d

15 files changed

+18
-18
lines changed

ports/zephyr/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MicroPython port to Zephyr RTOS
44
This is a work-in-progress port of MicroPython to Zephyr RTOS
55
(http://zephyrproject.org).
66

7-
This port requires Zephyr version v3.1.0, and may also work on higher
7+
This port requires Zephyr version v3.2.0, and may also work on higher
88
versions. All boards supported
99
by Zephyr (with standard level of features support, like UART console)
1010
should work with MicroPython (but not all were tested).
@@ -39,13 +39,13 @@ setup is correct.
3939
If you already have Zephyr installed but are having issues building the
4040
MicroPython port then try installing the correct version of Zephyr via:
4141

42-
$ west init zephyrproject -m https://github.com/zephyrproject-rtos/zephyr --mr v3.1.0
42+
$ west init zephyrproject -m https://github.com/zephyrproject-rtos/zephyr --mr v3.2.0
4343

4444
Alternatively, you don't have to redo the Zephyr installation to just
4545
switch from master to a tagged release, you can instead do:
4646

4747
$ cd zephyrproject/zephyr
48-
$ git checkout v3.1.0
48+
$ git checkout v3.2.0
4949
$ west update
5050

5151
With Zephyr installed you may then need to configure your environment,

ports/zephyr/machine_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <stdint.h>
3030
#include <string.h>
3131

32-
#include <zephyr/zephyr.h>
32+
#include <zephyr/kernel.h>
3333
#include <zephyr/drivers/i2c.h>
3434

3535
#include "py/runtime.h"

ports/zephyr/machine_pin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <stdint.h>
3030
#include <string.h>
3131

32-
#include <zephyr/zephyr.h>
32+
#include <zephyr/kernel.h>
3333
#include <zephyr/drivers/gpio.h>
3434

3535
#include "py/runtime.h"

ports/zephyr/machine_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <stdint.h>
2929
#include <string.h>
3030

31-
#include <zephyr/zephyr.h>
31+
#include <zephyr/kernel.h>
3232
#include <zephyr/drivers/spi.h>
3333

3434
#include "py/runtime.h"

ports/zephyr/machine_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <stdint.h>
3030
#include <string.h>
3131

32-
#include <zephyr/zephyr.h>
32+
#include <zephyr/kernel.h>
3333
#include <zephyr/drivers/uart.h>
3434

3535
#include "py/runtime.h"

ports/zephyr/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <stdio.h>
3030
#include <string.h>
3131

32-
#include <zephyr/zephyr.h>
32+
#include <zephyr/kernel.h>
3333
#ifdef CONFIG_NETWORKING
3434
#include <zephyr/net/net_context.h>
3535
#endif
@@ -106,7 +106,7 @@ STATIC void vfs_init(void) {
106106
mp_obj_t args[] = { mp_obj_new_str(CONFIG_SDMMC_VOLUME_NAME, strlen(CONFIG_SDMMC_VOLUME_NAME)) };
107107
bdev = MP_OBJ_TYPE_GET_SLOT(&zephyr_disk_access_type, make_new)(&zephyr_disk_access_type, ARRAY_SIZE(args), 0, args);
108108
mount_point_str = "/sd";
109-
#elif defined(CONFIG_FLASH_MAP) && FLASH_AREA_LABEL_EXISTS(storage)
109+
#elif defined(CONFIG_FLASH_MAP) && FIXED_PARTITION_EXISTS(storage)
110110
mp_obj_t args[] = { MP_OBJ_NEW_SMALL_INT(FLASH_AREA_ID(storage)), MP_OBJ_NEW_SMALL_INT(4096) };
111111
bdev = MP_OBJ_TYPE_GET_SLOT(&zephyr_flash_area_type, make_new)(&zephyr_flash_area_type, ARRAY_SIZE(args), 0, args);
112112
mount_point_str = "/flash";

ports/zephyr/modusocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "py/stream.h"
3232

3333
#include <stdio.h>
34-
#include <zephyr/zephyr.h>
34+
#include <zephyr/kernel.h>
3535
// Zephyr's generated version header
3636
#include <version.h>
3737
#include <zephyr/net/net_context.h>

ports/zephyr/modutime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "py/mpconfig.h"
2929
#if MICROPY_PY_UTIME
3030

31-
#include <zephyr/zephyr.h>
31+
#include <zephyr/kernel.h>
3232

3333
#include "py/runtime.h"
3434
#include "py/smallint.h"

ports/zephyr/modzephyr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#if MICROPY_PY_ZEPHYR
3030

3131
#include <stdio.h>
32-
#include <zephyr/zephyr.h>
32+
#include <zephyr/kernel.h>
3333
#include <zephyr/debug/thread_analyzer.h>
3434
#include <zephyr/shell/shell.h>
3535
#include <zephyr/shell/shell_uart.h>

ports/zephyr/modzsensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#include "py/runtime.h"
3030

31-
#include <zephyr/zephyr.h>
31+
#include <zephyr/kernel.h>
3232
#include <zephyr/drivers/sensor.h>
3333

3434
#if MICROPY_PY_ZSENSOR

ports/zephyr/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// Include Zephyr's autoconf.h, which should be made first by Zephyr makefiles
2929
#include "autoconf.h"
3030
// Included here to get basic Zephyr environment (macros, etc.)
31-
#include <zephyr/zephyr.h>
31+
#include <zephyr/kernel.h>
3232
#include <zephyr/drivers/spi.h>
3333

3434
// Usually passed from Makefile

ports/zephyr/mphalport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <zephyr/zephyr.h>
1+
#include <zephyr/kernel.h>
22
#include "shared/runtime/interrupt_char.h"
33

44
void mp_hal_init(void);

ports/zephyr/src/zephyr_getchar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <zephyr/zephyr.h>
17+
#include <zephyr/kernel.h>
1818
#include <zephyr/drivers/uart.h>
1919
#include <zephyr/drivers/console/uart_console.h>
2020
#include <zephyr/sys/printk.h>

ports/zephyr/src/zephyr_start.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26-
#include <zephyr/zephyr.h>
26+
#include <zephyr/kernel.h>
2727
#include <zephyr/console/console.h>
2828
#include "zephyr_getchar.h"
2929

ports/zephyr/zephyr_storage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ STATIC const mp_rom_map_elem_t zephyr_flash_area_locals_dict_table[] = {
244244
{ MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&zephyr_flash_area_readblocks_obj) },
245245
{ MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&zephyr_flash_area_writeblocks_obj) },
246246
{ MP_ROM_QSTR(MP_QSTR_ioctl), MP_ROM_PTR(&zephyr_flash_area_ioctl_obj) },
247-
#if FLASH_AREA_LABEL_EXISTS(storage)
247+
#if FIXED_PARTITION_EXISTS(storage)
248248
{ MP_ROM_QSTR(MP_QSTR_STORAGE), MP_ROM_INT(FLASH_AREA_ID(storage)) },
249249
#endif
250250
};

0 commit comments

Comments
 (0)
0