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

Building for BLE Nano2 with nRF5 SDK

Created a custom board .h file using this:

#ifndef RBLNANO2_H
#define RBLNANO2_H

#ifdef __cplusplus
extern "C" {
#endif

#include "nrf_gpio.h"

// LEDs definitions for RBL NANO 2
#define LEDS_NUMBER    1

#define LED_OB         11
#define LED_START      LED_OB
#define LED_STOP       LED_OB
   
#define LEDS_ACTIVE_STATE 0

#define BSP_LED_0	     LED_OB

#define LEDS_LIST      { LED_OB }
#define BSP_LED_0_MASK (1<<BSP_LED_0)
#define LEDS_MASK      (BSP_LED_0)
#define LEDS_INV_MASK  LEDS_MASK	

#define BUTTONS_NUMBER 0

#define RX_PIN_NUMBER  30
#define TX_PIN_NUMBER  29
#define CTS_PIN_NUMBER 28
#define RTS_PIN_NUMBER 2
#define HWFC           true

#ifdef __cplusplus
}
#endif

#endif // RBLNANO2_H

cloned the uart example that works fine on nRF52-DK and modified the Makefile to use above .h file. Build with gcc goes OK. Downloaded resulting hex file to BLE Nano2 using MK-20 - appears to go OK. No output on console.

Not sure what to try next to discover why printfs not working. My current guess is that SDK does not produce the right hex file format for the MK-20 loader. Could also be something to do with clock speeds. Anyone used the nRF SDK with BLE Nano?

Parents
  • There should not be any problems mapping pin 11. Looks like the led of the BLE Nano 2 is pulldown, while the LEDs of the PCA10040 is pullup. Can you try configuring and toggling the LED manually in your blinky example?

    #include "nrf_gpio.h"
    #include "nrf_delay.h"
    
    #define LED_PIN 11
    
    int main(void)
    {
    	/* Configure LED pin. */
        nrf_gpio_cfg_output(LED_PIN);
        nrf_gpio_pin_set(LED_PIN);
        
    	/* Toggle LEDs. */
        while (true)
        {
            nrf_gpio_pin_toggle(LED_PIN);
            nrf_delay_ms(500);
        }
    }
    
Reply
  • There should not be any problems mapping pin 11. Looks like the led of the BLE Nano 2 is pulldown, while the LEDs of the PCA10040 is pullup. Can you try configuring and toggling the LED manually in your blinky example?

    #include "nrf_gpio.h"
    #include "nrf_delay.h"
    
    #define LED_PIN 11
    
    int main(void)
    {
    	/* Configure LED pin. */
        nrf_gpio_cfg_output(LED_PIN);
        nrf_gpio_pin_set(LED_PIN);
        
    	/* Toggle LEDs. */
        while (true)
        {
            nrf_gpio_pin_toggle(LED_PIN);
            nrf_delay_ms(500);
        }
    }
    
Children
No Data
Related