This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

flash/fds hardfault not traceable

I am currently struggling with a problem where Im trying to implement the internal fds module which always leads to hard faults as follows:

There is probably something wrong in my configuration but I can't pinpoint where. The example worked okay so there are no problems on my own PCB. Yet I need support to handle this exception and get the config right!

Best, Julius

Parents
  • Hello,

    It is a bit difficult to say exactly why this is not working. What address are you trying to write to? Or perhaps there is an event handler that isn't populated properly being called? Is it possible to recreate the issue on a DK? If so, would it be possible to send the project that replicates this so that I can have a look?

    If not, I suggest you start looking into the call stack. What happens at event_send() right before the hardfault? Have you tried setting a breakpoint? Does it happen the first time this function (event_send()) is called, or is it called a couple of times before the error occurs?

    Best regards,

    Edvin

  • I am actually not writing anything. Basically I just initialize the flash module and afterwards dont use it (at least for now)

    the fault just happens randomly (an interrupt that is triggered?). Thats why I added the picture, this is all I have, if I set a breakpoint it will lead to the same call stack. 

    Yes it happens the first time the firmware goes into this event_send method. 

    Using a DK was a good advice, I couldn't recreate te problem there, is it something in the board configuration that needs to be handled? 

  • Hello,

    Yes, I was able to look into this on friday, and after modifying the project a bit, (from using printf to NRF_LOG_...(), changing a lot of the absolute paths for your .c files and include folders, are the two main things I remember now), I was able to reproduce the issue. It looks like the FDS is struggling to initialize the flash pages, although I didn't understand why. It requires some more debugging. I am sorry I didn't get back to you today, but I have not forgotten this ticket. I need to look deeper into it. 

    I saw that a lot of your project settings vary quite a bit from the normal SDK examples. I am not sure whether this is related to the behavior. And again, I am sorry I don't have a definitive answer for you at this point in time. I will try to look closer into this tomorrow. 

    I have, however, tried the unmodified flash_fds example, which doesn't behave the same as your project. I think my approach will be to copy your files into the flash_fds example, and see how it behaves then, to try a different approach, and to eliminate that the project settings may be the issue. Just in case you want to try to debug this as well. 

    Best regards,

    Edvin

  • Thanks for the answer!!

    I tried the same btw. FYI, I also used my sdk_config h file on the example and this didn't yield the behavior

  • Hi Edvin,

    I still havent figured this out (I didn't focus so much on it but want to get it done asap)

    Did you find out anything? how does the flash placement look? heap and stack sizes shouldn't interfere here I suppose?

    Best, Julius

  • Hello Julius,

    I have looked into it from time to time, but I can't figure out why it doesn't work. 

    I have tried to look for differences in your project settings and sdk_config.h, but so far with no luck. 

    I see that the project configurations in your project are quite different from what it is in our examples. Perhaps you have done everything yourself? Or did you start with an example from the SDK?

    One example of weird behaving settings is that your include directories shows up like this:

    But it actually include many more folders. Since this is a bit off, then perhaps there are plenty of other settings not showing correctly as well, for all I know.

    I also tested by adding your flash_tb_radar.c/h into the flash_fds example, and there it runs without any issues. (attached in case you want to test). 

    flash_fds_test_cust.zip

    Do you happen to know why the include directories setting looks like that? Does it do that in your case as well?

    Is there an option to go with the attached sample, and add the rest of your project to that?

    BR,
    Edvin

  • yeah, I suppose most include directories are in my solution options not the ones for the project (i.e. they are inherited)

    I will try to do it this way round, although its clear that by this I might just run into different problems.

    What I wanted to know is if you know how the attachment of the fds_evt_handler works exactly. THats where my application seems to crash, it doesn't go into the handler in the event_send function. 

Reply
  • yeah, I suppose most include directories are in my solution options not the ones for the project (i.e. they are inherited)

    I will try to do it this way round, although its clear that by this I might just run into different problems.

    What I wanted to know is if you know how the attachment of the fds_evt_handler works exactly. THats where my application seems to crash, it doesn't go into the handler in the event_send function. 

Children
  • I might have a clue, could need some confirmation and maybe help on that. After enabling the flash module I later use rtc_enable() in one of my modules. removing this module seems to not carry a hardfault any more but I cant really let that go. So what might be up here? 

  • I might have a clue, could need some confirmation and maybe help on that. After enabling the flash module I later use rtc_enable() in one of my modules. removing this module seems to not carry a hardfault any more but I cant really let that go. So what might be up here? 

Related