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

Modifying ble_app_uart from pca10028 to pca20006

I have customised the ble_app_uart example for my application and the modified code works with the DK board. When I wanted to deploy this to the beacon board (pca20006), I only changed BOARD_PCA100028 to BOARD_PCA20006 in Flash > Configure Flash Tools > Tab C\C++. And it worked immediately on the beacon.

I did not need change the device type to nRF51822_xxAA in tab Device. In fact, when I did, the libraries were marked red and the compiler threw lots of errors.

Why did that happen? I thought the beacon uses nRF51822.

Parents
  • Hi,

    Besides the lack of ANT support in nRF51822, the chips should have the same pin-out and HW architecture. It should be sufficient to change BOARD_PCA100028 to BOARD_PCA20006 as long as both your boards have the same amount of RAM and Flash available (see the IC revision overview in the compatibility matrix section at the infocenter).

    Changing the Device in Keil might reset the RAM and ROM settings, preventing you from flashing the application if a softdevice is present. It should however not cause any compile errors. Can you post the errors you are getting?

    Best regards,

    Jørgen

Reply
  • Hi,

    Besides the lack of ANT support in nRF51822, the chips should have the same pin-out and HW architecture. It should be sufficient to change BOARD_PCA100028 to BOARD_PCA20006 as long as both your boards have the same amount of RAM and Flash available (see the IC revision overview in the compatibility matrix section at the infocenter).

    Changing the Device in Keil might reset the RAM and ROM settings, preventing you from flashing the application if a softdevice is present. It should however not cause any compile errors. Can you post the errors you are getting?

    Best regards,

    Jørgen

Children
  • I changed the device from nRF51422_xxAC to nRF51822_xxAA. Since the ROM and RAM were reset, I changed IROM1 to Start: 0x18000, Size: 0x28000 and IRAM1 to Start: 0x20002000, Size: 0x6000.

    The preprocessor symbol was BLE_STACK_SUPPORT_REQD BOARD_PCA20006 S110 NRF51 SOFTDEVICE_PRESENT SWI_DISABLE0

    Built the code (I didn't change the output target - so still 'nrf51422_xxac_s110')

    *** Using Compiler 'V5.06 update 2 (build 183)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
    Build target 'nrf51422_xxac_s110'
    compiling app_uart_fifo.c...
    RTE\nRF_Drivers\nRF51822_xxAA\app_uart_fifo.c(117): error:  #20: identifier "UART0_CONFIG_PSEL_TXD" is undefined
          nrf_drv_uart_config_t config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    RTE\nRF_Drivers\nRF51822_xxAA\app_uart_fifo.c(117): error:  #20: identifier "UART0_CONFIG_PSEL_RXD" is undefined
          nrf_drv_uart_config_t config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    RTE\nRF_Drivers\nRF51822_xxAA\app_uart_fifo.c(117): error:  #20: identifier "UART0_CONFIG_PSEL_CTS" is undefined
          nrf_drv_uart_config_t config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    RTE\nRF_Drivers\nRF51822_xxAA\app_uart_fifo.c(117): error:  #20: identifier "UART0_CONFIG_PSEL_RTS" is undefined
          nrf_drv_uart_config_t config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    RTE\nRF_Drivers\nRF51822_xxAA\app_uart_fifo.c(117): error:  #20: identifier "UART0_CONFIG_HWFC" is undefined
          nrf_drv_uart_config_t config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    RTE\nRF_Drivers\nRF51822_xxAA\app_uart_fifo.c(117): error:  #20: identifier "UART0_CONFIG_PARITY" is undefined
          nrf_drv_uart_config_t config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    RTE\nRF_Drivers\nRF51822_xxAA\app_uart_fifo.c(117): error:  #20: identifier "UART0_CONFIG_BAUDRATE" is undefined
          nrf_drv_uart_config_t config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    RTE\nRF_Drivers\nRF51822_xxAA\app_uart_fifo.c(117): error:  #20: identifier "UART0_CONFIG_IRQ_PRIORITY" is undefined
          nrf_drv_uart_config_t config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    RTE\nRF_Drivers\nRF51822_xxAA\app_uart_fifo.c: 0 warnings, 8 errors
    compiling nrf_drv_uart.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\uart\nrf_drv_uart.c(74): error:  #20: identifier "UART0_CONFIG_PSEL_TXD" is undefined
      static const nrf_drv_uart_config_t m_default_config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\uart\nrf_drv_uart.c(74): error:  #20: identifier "UART0_CONFIG_PSEL_RXD" is undefined
      static const nrf_drv_uart_config_t m_default_config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\uart\nrf_drv_uart.c(74): error:  #20: identifier "UART0_CONFIG_PSEL_CTS" is undefined
      static const nrf_drv_uart_config_t m_default_config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\uart\nrf_drv_uart.c(74): error:  #20: identifier "UART0_CONFIG_PSEL_RTS" is undefined
      static const nrf_drv_uart_config_t m_default_config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\uart\nrf_drv_uart.c(74): error:  #20: identifier "UART0_CONFIG_HWFC" is undefined
      static const nrf_drv_uart_config_t m_default_config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\uart\nrf_drv_uart.c(74): error:  #20: identifier "UART0_CONFIG_PARITY" is undefined
      static const nrf_drv_uart_config_t m_default_config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\uart\nrf_drv_uart.c(74): error:  #20: identifier "UART0_CONFIG_BAUDRATE" is undefined
      static const nrf_drv_uart_config_t m_default_config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\uart\nrf_drv_uart.c(74): error:  #20: identifier "UART0_CONFIG_IRQ_PRIORITY" is undefined
      static const nrf_drv_uart_config_t m_default_config = 
    RF_DRV_UART_DEFAULT_CONFIG;
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\uart\nrf_drv_uart.c: 0 warnings, 8 errors
    compiling nrf_drv_gpiote.c...
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\gpiote\nrf_drv_gpiote.c(43): error:  #20: identifier "GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS" is undefined
          nrf_drv_gpiote_evt_handler_t handlers[
    UMBER_OF_GPIO_TE+GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS];
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\gpiote\nrf_drv_gpiote.c(157): error:  #20: identifier "GPIOTE_CONFIG_IRQ_PRIORITY" is undefined
          nrf_drv_common_irq_enable(GPIOTE_IRQn, GPIOTE_CONFIG_IRQ_PRIORITY);
    C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\gpiote\nrf_drv_gpiote.c: 0 warnings, 2 errors
    ".\_build\nrf51422_xxac_s110.axf" - 18 Error(s), 0 Warning(s).
    Target not created.
    Build Time Elapsed:  00:00:01
    
  • Those errors come from UART0 and GPIOTE being disabled in nrf_drv_config.h. Did you do any change to that file? Which SDK version are you using?

  • I see. I looked up nrf_drv_config.h when the device was nRF51422. It had #define GPIOTE_ENABLED 1 and #define UART0_ENABLED 1. When I switched the device type to nRF51822, it created a new copy of nrf_drv_config.h which had both GPIOTE and UART0 disabled.

    Then, when I looked up nrf_drv_config.h in Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.1.0\config, I noticed they were both disabled too. I was using SDK 10 (I think).

    I may have enabled them when working with the DK board last year. So switching to a new device will fetch the original file which had them disabled?

  • Are you using (the deprecated) CMSIS pack SDK? In the no-pack SDK v10, the file nrf_drv_config.h should be stored in [EXAMPLE_FOLDER]\config. This file should not be replaced or changed if you change the device.

  • Yes, I use CMSIS. When I switched to a new device, it created a new folder, s110\arm5\RTE\nRF_Drivers\nRF51822_xxAA, that contained nrf_drv_config.h with GPIOTE_ENABLED disabled. When switching to a new device, the RTEs had red-circles with white x. I had right-click on each h and s file and selected Update Config File (ver 0.0.0 -> ver ..*) to make the red-circles go away. This is a rather long painful process which is more like Keil's problem, not nRF. In the nutshell, what is the proper/correct way of switching to a new device?

Related