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

nRF51822 with emIDE and complete datasheet

I am starting with Nordic nRF51822 and I would like to know if do you have some samples for use with emIDE (I liked it because you don't have size limitation). And I had some doubts about interrupts implementation because the datasheet I downloaded doesn't have deep information about special register, interrupts neither instruction set. Do you have a more complete datasheet?

  • We don't have any experience with this internally, but I would expect it to be doable if you're ready to spend some effort on getting it working. It seems emIDE does support J-Links, and debugging using their GDB server, so I would expect it to also be possible to get it to build projects, either using an internal build system or external makefiles.

    It's not quite clear to me exactly what you find unclear, but the combination of the nRF51822 Product Specification, for electrical and chip-specific documentation, and the nRF51 Reference Manual, for register maps and peripheral descriptions, should cover all you need to know about the chip.

    Interrupt configuration is done through the common CMSIS interface, using the NVIC_* functions (or sd_nvic_* when the softdevice is enabled). For a description of interrupts as used by the different peripherals, you should refer to chapter 9 in the Reference Manual.

  • Thank you Morten.Your documentation helped a lot. I've got another issue trying it. In the ASM file "gcc_startup_nrf51.asm" used in some projects there is a piece of code that sometimes get stuck and I would like to know what this code does. Why it copies data from Flash to RAM? Do you know it?

    /* Loop to copy data from read only memory to RAM. The ranges

    • of copy from/to are specified by following symbols evaluated in
    • linker script.
    • __etext: End of code section, i.e., begin of data sections to copy from.
    • data_start/data_end: RAM address range that data should be
    • copied to. Both must be aligned to 4 bytes boundary. */
    ldr    r1, =__etext
    ldr    r2, =__data_start__
    ldr    r3, =__data_end__
    
    subs    r3, r2
    ble     .LC0
    

    .LC1: subs r3, 4 ldr r0, [r1,r3] str r0, [r2,r3] bgt .LC1 .LC0:

  • I've never seen this loop causing any trouble, so I suspect there could be something else that is the root cause. Are you sure you use the startup file from our SDK?

    As for why it copies from flash to RAM, that's strictly needed to initialize all variables with a preset value. You may have use in taking a look at this question over at Stack Overflow: http://stackoverflow.com/questions/5430284/rom-and-ram-in-arm Alternatively, this tutorial also seems to explain the same concept: http://mcuoneclipse.com/2013/04/14/text-data-and-bss-code-and-data-size-explained/

Related