This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

HardFault of SystemInit

Hi,

I'm trying to deploy the example program, cifar10, from CMSIS-NN library on NRF52. The issus is I compiled and downloaded it to the board successfully but when I try to debug, it alwasys stays in HardFault_Handler.

I checked the code and found the problem occurs when I referenced a variable "conv2_wt", which is an INT_8 array with length 32*5*5*16=12800. (If I delete this line the program will be OK)

I guess the problem is about the stack size or something like that but I dont konw how to fix it.

Thanks.

Parents Reply
  • Hi,

     

    Here's a window that shows the call stack in the lower right corner, which shows what functions I'm in:

     

    However; I see from your stack pointer that this isn't going well. Its set at 0x20014418, which indicates that approx. 82 kB of RAM is used. This will not run properly, as the nRF52832 has 64kB of RAM.

    As previously mentioned, please remove the __STACK_SIZE=64k that you have in your project, re-compile, and enter debug mode again to see if the fault occurs. If it occurs, please post the whole picture of the IDE.

     

    Kind regards,

    Håkon

Children
Related