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

Initialisation in Blinky example

I recently purchased nRF52840 DK. While scanning through the website, I came across a suggestion to start with Blinky example. I opened the project in Segger Embedded studio. A build and Run with kit connected, I could see the project working.

I wished to find out the various initialisation; this includes stack initialisation, initialisation of various features of nRF52840 chipset.

The function

bsp_board_init(BSP_INIT_LEDS);

initialises the pin out for LED. I had assumed that there would be more on initialisation.

Can someone point me in right direction? Thanks in advance

Parents Reply Children
  • @Jared

    Many thanks for your response

    I have already downloaded SDK (the full folder name on my computer is nRF5SDK160098a08e2). I have followed the suggestion on infocenter and I am using the Blinky without Softdevice (from the blank folder).

    I go back to my original question. The Blinky project was ‘build and run’; this downloaded the program (hex file) into the kit. I could see the LED working.

    I wish to find out the various initialisation; this includes stack initialisation, initialisation of various features of the nRF52840 chipset.

    The function

    bsp_board_init(BSP_INIT_LEDS);

    initialises the pin out for LED. I had assumed that there would be more on initialisation.

  • "Blinky without Softdevice" indicates that you're using a project that doesn't use BLE. So exactly which stack initialization are you expecting? Also, what features?  The peripherals of the nRF? 

    Himanshu said:

    The function

    bsp_board_init(BSP_INIT_LEDS);

    initialises the pin out for LED. I had assumed that there would be more on initialisation.

     Why are you assuming that? 

  • My assumption is based on my previous experience with microcontroller.

    When the controller is reset, the first instruction is to initialise stack pointer, pointing to the intended area of the RAM.

    I assume that the other features (NFC, I2S SPI) are left to default power up state(please confirm) but what about the stack pointer

  • The MSP is initialized in the startup files of the project. See arm_startup_nrf52840.s and gcc_startup_nrf52.s files at SDK_ROOT\modules\nrfx\mdk

    Himanshu said:
    I assume that the other features (NFC, I2S SPI) are left to default power up state(please confirm) but what about the stack pointer

     Yes, they will not be activated unless requested explicitly.

    regards

    Jared

Related