This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

it can't boot to dfu mode.

I have a Nordic 52840 hardware, which comes with the bootloader. Learned that the register GPREGRET address is 0x4000051C. The app is written in rust language, and the address is assigned 0xB1 directly in the app. But  it can't  enter the dfu mode.
code show as below:

let gpregret = 0x4000051Cusize;
         let pa = gpregret as * mut i32;
         unsafe {
             * pa = 0xB1;
         };

Am I writing it wrong?

thank you!

Parents Reply
  • If you are running code on the nRF that you write in Rust, then you must have the basic infrastructure in place, and I would be very surprised if it did not support core ARM functions such as NVIC reset. I do not know any details about what you are using though, so I cannot say more. Please note that Rust is not officially supported. If you want to do some real work, then I suggest you use the nRF5 SDK and program in C. If you use rust for fun or research that is, of course, fine, but you are more or less on your own.

Children
  • Google have  an opensource on github with nordic hardware, it's name opensk.

    I can flash app .And I what enter DFU mode to update with button less.

    But i have no idea.

  • Please note that Rust is not officially supported. If you want to do some real work, then I suggest you use the nRF5 SDK and program in C. If you use rust for fun or research that is, of course, fine, but you are more or less on your own.

    I can't let this stand without comment :-)

    While it is certainly true that Rust is not officially supported by Nordic or any MCU vendor that I know of, people can and do absolutely use it for "real work". Supporting companies that do this is what I do for a living, and I've been fully booked with Rust/Cortex-M work for about a year now. And I'm not even the only provider in this space.

    So please do use Rust for any work (real or not) where you see a benefit in doing so :-)

Related