[SOLVED] hardfault just on start

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] hardfault just on start

    I build an example start from the strat example and take in some part of the fds_fstorge from Nordic. It build after some modifications
    I create two task and init the OS and HW. The main is as standard as this
    int main(void) {
    OS_Init(); // Initialize embOS
    OS_InitHW(); // Initialize required hardware
    OS_TASK_CREATE(&TCBFS, "FS Task", 50, MainTask, StackFS);// the File System task
    OS_TASK_CREATE(&TCBNOR, "NOR Task", 100, NorTask, StackNOR);// the ex NOR direct handling task
    NRF_LOG_INFO("embOS OS_FileSystem example");
    NRF_LOG_INFO("\n\nDemonstrating Qspi DMA use\n");
    OS_Start(); // Start embOS
    return 0;

    When run it after the OS_Start it fail on hardfault. Didn't even get to start of the first task. When I omit the second task it get to the first function in the first task and then fail. When I omit the first task it getto the first function of the second task and fail. As I look in the HardFault_handler and from what I read it is look it has Bus fault like memory error. I couldn't get it to go out of the hatdfault_handler by set _Continue =1;
    When I compare it to other examples with the some setting on start it run there.
    It is look to me that something happened with it memory or stack arrangement, but I don't know where to look it for.
    1. Any clue how can I get more data from the hardfaultHandler (attach screen shot with the relevant register values open on the right) ?
    2. Which file can be check for this problem?
    • hardfault window.png

      247.58 kB, 1,920×1,080, viewed 800 times
  • Hi.
    I didn't change any of the original files just add some. But I made some changes in the xml file which could effect.
    The StackNOR and StackFS define as the TaskHP, TaskLP. I also try to change there size and priority.
    Because it fail on start it look to me that something in the memory usage is wrong.
    I send you a link to the project.