flash operations with the nRF5x devices

Posted on
  • Working on my port to the nRF52 and trying to get Flash to work. I want to be able to save() and load() code etc...

    I've been having some problems and now that I'm using the Flash module I can kind of debug them. When I call Flash.erasePage(0x0); Espruino basically stalls out (but when I read flash memory through nrfjprog.exe it does look like the page was actually erased). It doesnt print anything else after that and the terminal looks like it just freezes. I can't even hard reset the board after it.

    I kind of have a theory: whenever you do a flash operation with nRF5x devices the non-volatile memory controller takes control and does it for you. (you just configure it for read or write, pass it the address (and value) and then wait for it to finish). However it halts the CPU while it is doing this. Could this be causing the problem I'm seeing? Any work arounds or other ideas about the issue? I think same issue happens when I try to save() and load() code. Espruino just freezes

  • Well, haven't you just deleted the flash memory at bytes 0-4097? That'll include the vector table, and probably a bunch of program code that Espruino needs?

    To test, you probably want to delete something significantly further up?

  • If it's happening when you load or save as well, does that mean that the address in flash memory for writes is in the wrong place?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

flash operations with the nRF5x devices

Posted by Avatar for mjdietz @mjdietz

Actions