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

Using stlink and Keil to program nrf51

Hi! I have a small issue with one of my current project. I've built myself a custom board using the nrf51822QFAA. And I am using an stlink (on an stm32f4 discovery) instead of jlink that is included with dev kits.

I can build the example and load it onto my board using OpenOCD (softdevice included). That works nicely. But I can not do it using Keil. Now I've never used Keil before so I am not completely familiar with it. I've modified the target and selected Stlink under the debug tab. I've also selected the correct device under the device tab. But whenever I want to download the program I get the "Flash download failed - Cortex M0". With these messages before that: "no algorithm found for 0018000H-0001B1D7H, erase skipped".

I have tried completely erasing the chip using OpenOCD using the nrf51 mass_erase before using Keil but it doesn't seem to help.

Any ideas on what I am doing wrong?

Parents
  • Ensure that after you switch to the ST-link as the debugger, you go into settings and change the 'Port' from the default of 'JTAG' to 'SW'. You might also want to check the 'reset and run' box under the flash download tab to avoid power-cycling the device when you want to test the newly flashed code.

    The ST-link is my standard debug interface and I've been through all the pains with it, so feel free to ask if you are still experiencing issues.

Reply
  • Ensure that after you switch to the ST-link as the debugger, you go into settings and change the 'Port' from the default of 'JTAG' to 'SW'. You might also want to check the 'reset and run' box under the flash download tab to avoid power-cycling the device when you want to test the newly flashed code.

    The ST-link is my standard debug interface and I've been through all the pains with it, so feel free to ask if you are still experiencing issues.

Children
No Data
Related