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

Programming different nRF51822 boards how to prog S110 & App?

Hi All,

I am an electronics engineer but new to nRF51822 programming. I have used the PCA10000 & PCA10001 using Nordic SDK, using nRF Studio etc. In nRF Studio, you can program the S110 protocol independently from your own application. I am now trying to program a couple of other modules from a 3rd party, these are: T1RU.hXeXiXXXXXXXX_!!0-item_pic.jpg_460x460.jpg And some PTR5518. I came across this posting here: link text.

The posting is useful however, I am a little confused; I understand that I need to use the SWDIO & SWDCLK pins which I am aware of. I am also using an STM32F0discovery board for programming them which I read was able to program these modules: link text albeit for Linux.

My confusion is; what software do I use to do the programming? In the past with Nordic dev boards I used the nRF Studio which would allow me to program S110 and my own app independently. This board has SWDIO & SWDCLK but obviously wont be compatible with nRF Studio which means I cant program S110 and app separately. If I cant do that, how do you program the S110 into the right memory area (as nRF Studio does)?

I am sorry, I hope I have explained it properly. Initially to program the third party units, I connected a board to the SWDIO & SWDCLK of the PCA board and switched off the slide switch next to the Reset button but and tapped the power jumper/headers next to the Reset button, however, something still seems to be missing as it doesnt seem to program it correctly; if I program S110 first and then app, error is returned "CPU not in reset", if I do app first and then S110, no errors but it doesn not seem to be programmed as it doesnt work.

Is there a particular sequence for the SWDIO and Reset & programming procedure?

Any one can help?

Thanks very much. Sean

Parents
  • Hi Sean,

    The nRF51822 uses SWD (Serial Wire Debug), which is a younger cousin ofJTAG, for flashing and debugging boards. Ostensibly, any SWD controller (interface? flasher? I'm not sure of the correct name) will be able to flash or debug the nRF51822.

    Practically, Segger is the only manufacturer that makes an out of the box SWD solution for the nRF51822, at this point in time. Hence, they can charge a lot for their SWD products since there's not much competition. You may have noticed the Segger's IC on the dev kit, they also make these on-PCB SWD controllers that are distributed in dev kits so customers don't have to buy a discrete SWD controller to trial microcontrollers.

    I am not sure if the Segger SWD controller on the dev kit is somehow "locked" to the specific nRF51822 on each board or if it would work as a stand-alone SWD programmer if you could cut the traces from the SWDIO and SWDCLK pins to the on-board nRF51822 and break them out to your custom hardware.

    Even if this works, I doubt Nordic can tell you to do it, since it probably violates their licensing agreement with Segger, who would prefer you buy their commercial products. You can also find unauthorized clones of Segger programmers on Ebay or similar sites, which may or may not work, but certainly also violate Segger's software licensing agreement and diminishes the profits from their hard work :)

    The site you linked mentions OpenOCD, which is an open source free software project that is capable of driving a variety of SWD or JTAG flashers/debuggers, many of which are much cheaper than a Segger J-Link.

    For instance, OpenOCD lets you use an STM ST-Link V2, which normally would only work with STM products when you use STM's software to control it, to program anything that uses an SWD interface, including the nRF51822. The ST-Link V2 is available for about $30 or as part of an STM dev kit, built into the circuit board.

    However, caveat emptor, OpenOCD is still quite fresh and not the easiest software to use. There are known bugs that make it difficult to use out of the box with the nRF51822, however if you're willing to take the time you can find patches and even improve the project yourself.

    My experience from a few months ago is that it will take about a full day to get OpenOCD running and patched to use an ST-Link V2 with the nRF51822. OpenOCD didn't flash nearly as fast as a Segger J-Link, but that could have been improved.

    If money is your constraint, then try OpenOCD and an ST-Link V2, since it's a very promising project that is getting better with every release, but it might take some time to get running.

    If you need things to work quickly, use a Segger J-Link and their flashing software. Their software works better on Windows than Linux or OS X, in my experience.

    Good luck!

  • Hah, no worries, I realized it was showing my real name instead of a handle, so I changed it.

    All this stuff can be tricky to figure out at first since the information is very scattered around. Your application should start at the end address of the S110, which is 0x16000 for version 7.x.x. The S110 starts at 0x00. I'm not familiar with Keil, so I can't provide specific help, but I'd recommend learning how to specify your memory map to the compiler so your application starts at the right address.

    Srec_cat can help you concatenate hex files and it might even let you shift around their addresses. I know Nordic also provides a similar tool for gluing hex files together but the name escapes me.

Reply
  • Hah, no worries, I realized it was showing my real name instead of a handle, so I changed it.

    All this stuff can be tricky to figure out at first since the information is very scattered around. Your application should start at the end address of the S110, which is 0x16000 for version 7.x.x. The S110 starts at 0x00. I'm not familiar with Keil, so I can't provide specific help, but I'd recommend learning how to specify your memory map to the compiler so your application starts at the right address.

    Srec_cat can help you concatenate hex files and it might even let you shift around their addresses. I know Nordic also provides a similar tool for gluing hex files together but the name escapes me.

Children
No Data
Related