Skip to content

Commit d201c8b

Browse files
committed
Switch to Zephyr USB + QoL changes
* Enable full builds * Two additional NXP boards
1 parent c2f97a2 commit d201c8b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+982
-414
lines changed

main.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,21 +219,23 @@ static void stop_mp(void) {
219219

220220
// Unmount all heap allocated vfs mounts.
221221
mp_vfs_mount_t *vfs = MP_STATE_VM(vfs_mount_table);
222-
do {
223-
if (gc_ptr_on_heap(vfs)) {
224-
// mp_vfs_umount will splice out an unmounted vfs from the vfs_mount_table linked list.
225-
mp_vfs_umount(vfs->obj);
226-
// Start over at the beginning of the list since the first entry may have been removed.
227-
vfs = MP_STATE_VM(vfs_mount_table);
228-
continue;
229-
}
230-
vfs = vfs->next;
231-
} while (vfs != NULL);
222+
if (vfs != NULL) {
223+
do {
224+
if (gc_ptr_on_heap(vfs)) {
225+
// mp_vfs_umount will splice out an unmounted vfs from the vfs_mount_table linked list.
226+
mp_vfs_umount(vfs->obj);
227+
// Start over at the beginning of the list since the first entry may have been removed.
228+
vfs = MP_STATE_VM(vfs_mount_table);
229+
continue;
230+
}
231+
vfs = vfs->next;
232+
} while (vfs != NULL);
232233

233-
// The last vfs is CIRCUITPY and the root directory.
234-
vfs = MP_STATE_VM(vfs_mount_table);
235-
while (vfs->next != NULL) {
236-
vfs = vfs->next;
234+
// The last vfs is CIRCUITPY and the root directory.
235+
vfs = MP_STATE_VM(vfs_mount_table);
236+
while (vfs->next != NULL) {
237+
vfs = vfs->next;
238+
}
237239
}
238240
MP_STATE_VM(vfs_cur) = vfs;
239241
#endif

ports/zephyr-cp/app.overlay

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
&zephyr_udc0 {
2+
cdc_acm_console: cdc_acm_console {
3+
compatible = "zephyr,cdc-acm-uart";
4+
label = "CircuitPython Console";
5+
};
6+
cdc_acm_data: cdc_acm_data {
7+
compatible = "zephyr,cdc-acm-uart";
8+
label = "CircuitPython Data";
9+
};
10+
};

ports/zephyr-cp/boards/board_aliases.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ set(nordic_nrf54l15dk_BOARD_ALIAS nrf54l15dk/nrf54l15/cpuapp)
55
set(nordic_nrf54h20dk_BOARD_ALIAS nrf54h20dk/nrf54h20/cpuapp)
66
set(nordic_nrf5340dk_BOARD_ALIAS nrf5340dk/nrf5340/cpuapp)
77
set(nordic_nrf7002dk_BOARD_ALIAS nrf7002dk/nrf5340/cpuapp)
8+
set(nxp_frdm_mcxn947_BOARD_ALIAS frdm_mcxn947/mcxn947/cpu0)
9+
set(nxp_mimxrt1170_evk_BOARD_ALIAS mimxrt1170_evk@A/mimxrt1176/cm7)
810
set(st_stm32h7b3i_dk_BOARD_ALIAS stm32h7b3i_dk)
911
set(st_nucleo_u575zi_q_BOARD_ALIAS nucleo_u575zi_q/stm32u575xx)
1012
set(st_nucleo_n657x0_q_BOARD_ALIAS nucleo_n657x0_q/stm32n657xx)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
&s28hl512t {
22
/delete-node/ partitions;
33
};
4+
5+
#include "../app.overlay"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
&w25q64jvssiq {
2+
/delete-node/ partitions;
3+
};
4+
5+
#include "../app.overlay"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
&is25wp128 {
2+
partitions{
3+
/delete-node/ storage_partition;
4+
circuitpy_partition: partition@E20000 {
5+
label = "circuitpy";
6+
reg = <0x00E20000 (DT_SIZE_M(2) - DT_SIZE_K(128))>;
7+
};
8+
};
9+
};
10+
11+
#include "../app.overlay"

ports/zephyr-cp/boards/nordic/nrf54h20dk/autogen_board_info.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ touchio = false
100100
traceback = true
101101
uheap = false
102102
usb = false
103-
usb_cdc = false
103+
usb_cdc = true
104104
usb_hid = false
105105
usb_host = false
106106
usb_midi = false

ports/zephyr-cp/boards/nrf54h20dk_nrf54h20_cpuapp.overlay

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@
4343
memory-regions = <&cpuapp_dma_region>;
4444
status = "okay";
4545
};
46+
47+
#include "../app.overlay"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// No app.overlay because it doesn't have USB.

ports/zephyr-cp/boards/nucleo_n657x0_q.overlay

Whitespace-only changes.

0 commit comments

Comments
 (0)