Yes I need to do a renaming and tidy for sure.
I'm not sure why the code I've got generates faults like crazy, I'm thinking it's most likely because it's test code and not an actual project.
I'm using the RP2350 I looked through the memory portion of the data sheet. I seem to remember there was a memory map graphic somewhere? Right now I'm just trying to understand what each register is and what it's for. I am not afraid to admit I'm not sure what they are all for.
Good to know that it maybe possible to recover from a hard fault. I'm going to have the code drop to a fault screen and reset to continue will be required. Panics are not common on my projects it's nice to know I can catch them now as well and carry on.
My suspicion is that there is unaligned memory going on. There was a warning from tinyUSB code
I'm not sure why the code I've got generates faults like crazy, I'm thinking it's most likely because it's test code and not an actual project.
I'm using the RP2350 I looked through the memory portion of the data sheet. I seem to remember there was a memory map graphic somewhere? Right now I'm just trying to understand what each register is and what it's for. I am not afraid to admit I'm not sure what they are all for.
Good to know that it maybe possible to recover from a hard fault. I'm going to have the code drop to a fault screen and reset to continue will be required. Panics are not common on my projects it's nice to know I can catch them now as well and carry on.
My suspicion is that there is unaligned memory going on. There was a warning from tinyUSB code
Code:
/pico-sdk/lib/tinyusb/src/osal/osal_pico.h:120:25: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member] 120 | critical_section_init(&qdef->critsec);
I've made this change as wellTo fix thewarnings like this(from pico-sdk/lib/tinyusb/src/osal/osal_pico.h):I added an aligned attribute to a struct real quickCode:
pico-sdk/lib/tinyusb/src/osal/osal_pico.h:147:25: warning: taking address of packed member of 'struct <anonymous>' may result in an unaligned pointer value [-Waddress-of-packed-member] 147 | critical_section_exit(&qhdl->critsec); | ^~~~~~~~~~~~~~
Lines 105-108 of pico-sdk/lib/tinyusb/src/osal/osal_pico.hwas added... hopefully it doesn't break funcionalityCode:
typedef struct { tu_fifo_t ff; struct critical_section critsec; // osal_queue may be used in IRQs, so need critical section} __attribute__((aligned(4))) osal_queue_def_t; // Align to 4 bytes__attribute__((aligned(4)))
Statistics: Posted by DarkElvenAngel — Wed Jan 15, 2025 11:41 pm