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

Getting started with nrf51822 modules and st-link.

Hello.

I'm tying to learn nrf51822. I had ordered some modules from ebay and nrf52-dk from local distributor . A week ago I had receive some modules. But local distributor says that nrf52-dk is late and won't delivered before middle of January. So, I'm trying to work with modules and st-link from st32nucleo board. And I had faced the some problems.

Here is that's modules: www.ebay.com/.../192371985227 (E77-2G4M04S)

[1].Have someone know something about it?

As I haven't original j-link, I'm trying to work through st-link (from stm-nucleo board).

As I understand before working with any examples I must flash softdevice into nrf51822 module, and after that I can flash exampls. Currently I have two modules, one of them already was erased few times by me. Another module has stayed with default firmware, but I don't know what is it and what version is it.

[2]. Is it possible to figure out what is contains by default into ROM of that's module?

When I try to flash blank (erased) module, I had faced some issues:

[3]. Into what ROM address a must flash softdevice (for example s130). As I understand, softdevice must be placed before application, and as I suppose, it must be 0x0. And, in this case, application must be plased starts from 0x1B00. Am I right?

[4]. Is it bootloader (or something else) must be placed before softdevice? And if it is, what is it and where I can get it and how a can flash it into ROM?

[5]. Is it possible to get know that softdevice had written (flashed) ok? (considering thats, nrf51822 module hasn't any leds or buttons. just SWCLK, SWDIO, GND, VCC and IO pins)

[6]. I have tried flash softdevice into module (starts from 0x0 ROM address) through st-link (Keil). But after that, a can't flash any examples (starts from 0x1B00) - I've got message "Programming Failed! Error: Flash Download failed - "Cortex-M0"". So, I think I'm missed something but I don't know what.

Parents
  • Then let's take it one by one:

    • [1].Have someone know something about it? - yes, as many ST-Link and nRF5x posts as many you find through search function on this forum.
    • [2]. Is it possible to figure out what is contains by default into ROM of that's module? - yes, as lon as flash (NVM) isn't read-back protected you can "dump" it (or "read" if you want) by any SWD programmer which has that feature (ST-Link should be one of them).
    • [3]. Into what ROM address a must flash softdevice (for example s130). - as you can read in all documentation and tutorials flash (NVM) of all nRF5x chips strts at address 0x00000000, there you need to flash the soft device. But because Soft Device comes in HEX format which already contains addressing you typically never care about this. Then depending on Soft Device type and version you need to link your application FW on right address. Again it's the best to generate HEX file which takes care about addresses but if you insist on pure BIN output then you need to look to particular Soft Device release notes to get the right address.
    • [4]. Is it bootloader (or something else) must be placed before softdevice? - no, bootloader isn't necessary as all ARM Cortex-M chips are typically programmable by SWD/JTAG interface. You can develop your own bootloader (e.g. to upgrade stack and application code later in the field over radio or wired interface such as UART/USB/etc. without SWD programmer such as J-Link or ST-Link) or adopt some of Nordic bootloader examples. However that is typically loaded to higher memory address (ten study some of these examples and blog posts).
    • [5]. Is it possible to get know that softdevice had written (flashed) ok? - every SWD programmer (including ST-Link) can verify written code right after flashing so you should use that way. Soft Device contains just radio stack implementation and other auxiliary features but without application code running on top it does absolutely nothing.
    • [6]. I've got message "Programming Failed! Error: Flash Download failed - "Cortex-M0"" - there are several things which might be done by bloody Keil on the background. You will need to try the whole flashing procedure (preferably of some HEX binaries delivered with nRF5 SDK by Nordic which are known to be 100% working) by some utility which allows debug logging (ST provides flashing SW of the same name as ST-Link if I'm correct, but you can face issues with chip identification and memory layout, also OpenOCD should work with ST-Link and nRF5x chips).

    Good luck

  • (1/2):

    1. Sorry I misunderstood. If you ask about this specific module I have nothing to add.
    2. If you dump it then you compare the memory areas with all Soft Device versions in question. It must match 100% otherwise its not that particular SD version. Easy and clear as black and white.
    3. Solved.
    4. Solved.
    5. You asked about SD only and the answer is no, you cannot verify Soft Device functionally because it does nothing! Yes, you should flash it with some application and then you can verify whatever application allows you: LED blinking, buzzer beeping, UART printing some strings, radio shining to the universe... the problem is that all ready-made examples are delivered only for Nordic Dev Kits (which is logical, they cannot cover all obscure Chinese modules), so the proper sequence would be a) develop something with PIN and LFCLK settings on nRF5x DK and b) try it on target.
Reply
  • (1/2):

    1. Sorry I misunderstood. If you ask about this specific module I have nothing to add.
    2. If you dump it then you compare the memory areas with all Soft Device versions in question. It must match 100% otherwise its not that particular SD version. Easy and clear as black and white.
    3. Solved.
    4. Solved.
    5. You asked about SD only and the answer is no, you cannot verify Soft Device functionally because it does nothing! Yes, you should flash it with some application and then you can verify whatever application allows you: LED blinking, buzzer beeping, UART printing some strings, radio shining to the universe... the problem is that all ready-made examples are delivered only for Nordic Dev Kits (which is logical, they cannot cover all obscure Chinese modules), so the proper sequence would be a) develop something with PIN and LFCLK settings on nRF5x DK and b) try it on target.
Children
No Data
Related