Configuring Sparklet for IMXRT1170

Other Considerations

Some of the memory is allocated by external code and is used inside Sparklet. For example, certain RAM addresses are allocated by business logic and provided to Sparklet via sgui_get_ram_bin_addr() (in imxrt1170_bsp.c). These sections must be aligned for certain boundaries for proper operation, otherwise it leads to memory alignment exceptions. It can be achieved via attribute alignment:

 1#define RAM_BIN_BUF_SIZE        (256)
 2uint8_t u8_ram_bin_buf [RAM_BIN_BUF_SIZE];
 3void *sgui_get_ram_bin_addr (int32_t u32_offset)
 4{
 5 if (u32_offset >= RAM_BIN_BUF_SIZE)
 6              {
 7               sgui_app_report_error(11, 11, NULL);
 8              }
 9
10             return &u8_ram_bin_buf [u32_offset];
11}