This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

blocked task for 3 seconds

Hi,

If I want to run a blocked task e.g. write 1MB data to the external flash size 8MB(NVRAM), that it takes 3 seconds. What is the best way to to in NRF 51822?

Do you think we could wrap pstorage for external flash?

For the communication protocol, we use GPIO simulate SPI and yes we use softdevice 1.0.

Thanks.

Paul

  • I don't quite understand. The nRF51822 doesn't have any NVRAM, it has a flash memory of 256KB. Is it an extern NVRAM? Where does this 1MB data come from?

  • What interface does the external memory have?

    Are you using a SoftDevice?

  • Block what? If you are the only user of the CPU you can turn off interrupts and do whatever you want.

    Or is this another 'how do I stop the softdevice interrupting me so I can do precision timing' question, which gets asked a couple of times a week? The answer to that is you cannot, the softdevice wins, it has higher priority than anything you are doing and you can't change that or it will lose timing and it will lose the connection.

    Why are you simulating SPI over GPIO? The chip has an SPI master on it.

    Edit: since you edited your question to say you are using the softdevice the answer remains the same. You can't do it, at all. You can't block for 3s, 3ms or 3us. So you can't bitbang time-sensitive protocols when using BTLE on the nrf51822.

    Why are you not using the SPI master on the chip?

  • It's blocked what a long read e.g. 3 second read from NVRAM. If I use pstorage, it should be done async, i.e. call pstorage_update and wait for callback event PSTORAGE_UPDATE_OP_CODE.

    I'm not sure whether it could be done on an external flash if the interface is SPI over GPIO. The "SPI over GPIO" was told by my colleague. I'm not that low level of firmware engineer. I'll check with my colleague whether we could use SPI directly.

Related