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? 

  • So if you flash the same application to a DK without changing anything the issue doesn't occur? Have you tried erasing both boards completely before flashing the application? (nrfjprog --eraseall)

    Apart from that I can't think of anything that would cause a hardfault. One typical thing that causes different behavior is the lack of LFXTAL in some custom boards, but that would typically cause a stall, not a hardfault. Does your custom PCB have an LFXTAL (low frequency xtal?).

    Was the FDS the last thing you added? If you comment out your initialization of FDS/fstorage, does the device hardfault?

    Best regards,
    Edvin

  • I am using a LFXTAL and erased all software as well.

    yeah Im curious whats going on as well. I also used the example on my custom PCB and that works ok. So there must be some weird interaction between board, flash and whatever else in the configuration (I also commented out all of the other modules and the hardfault still occurred)

    fds was indeed the last thing I added and the device works fine without. 

Reply
  • I am using a LFXTAL and erased all software as well.

    yeah Im curious whats going on as well. I also used the example on my custom PCB and that works ok. So there must be some weird interaction between board, flash and whatever else in the configuration (I also commented out all of the other modules and the hardfault still occurred)

    fds was indeed the last thing I added and the device works fine without. 

Children
  • Do you use FreeRTOS? Does your application currently use the softdevice? I.e. do you enable the BLE stack from your application? 

    Either way, I think you need to start debugging. Use breakpoints to see how far your application gets before it hardfaults. If you use the softdevice, you need to set breakpoints, wait for it to hit, and then move the breakpoint and reset the application. 

    Start checking around the event_send(). Try to set a breakpoint and see where it is coming from, and what it tries to do. What file is this function implemented in?

    Best regards,

    Edvin

  • Its not like I didnt, as I said, there is no other outcome than what I have right now. The event_send is also triggered if I somewhat alter the code and leave out other snippets. 

    its an sd_event_IRQHandler that is triggered all of the sudden and probably interfering with anything .

    event_send is one of nordics functions in nrf_storage_sd.c triggered by fstorage_sys_evt_handler and at the beginning its sd_event_IRQHandler

    Also, I tried this again on my DK and it happened there too now.

    When I only init the flash and don't do anything else, it wont crash, as soon as I use fds_stat or any other action on flash write/read it will show this error. 

  • If you are able to reproduce this on a DK now, perhaps you can zip your project and upload it here? You can exclude any potential sensitive information. If the project is a strip down, containing only the bare minimum required to reproduce the issue, without too much of your custom code, that would be the best. Then I can try to reproduce it here in the office.

    What SDK version are you using?

    Best regards,

    Edvin

  • flash_corrupt_ex.ziphere you go. I literally deleted everything from my main and excluded all of my files except the flash_init part (I also commented out ble_stack_init() in there) 

    I am using 15.3 rn

    Thank you Edvin

  • Hi Edvin,

    were you already able to check this? 

    Greetings

Related