I need advice on software configuration of BMD-300 on custom pcb to boot on power-up and advertise in UART mode

Hi DevZone friends,

I have compiled and downloaded the /examples/ble_peripheral/ble_app_uart project to a ubloxBMD-300 series evaluation board and everything works OK, I can send and receive data without any problem. I designed a simple custom pcb to mount the nRF52832 BMD-300 bluetooth module and connected this to the dev kit for programming. Prior to programming, the custom board advertised as "RigCom" device and could be detected using the Nordic nRF Toolbox app on my mobile. Once programmed however, the device does not advertise and is not visible using the Nordic app. The problem appears similar to that reported earlier "Peripheral_LBS example works on a BMD-300 DK but not on a custom board with BMD-300" in which the solution appears to be a modification of prj.conf file. I should also mention that verify returns OK report once the device is programmed, an un-programmed device plugged into the dev kit returns an error on verify.

At this stage I am unsure if the custom pc is booting, I have a pullup resistor and 1 uF cap on the the  reset line which should serve to deliver a reset pulse on power-up. I can troubleshoot this further but I'm assuming from the suggested fix to the "Peripheral_LBS example works on a BMD-300 DK,,," problem that the system clock is not properly configured.

I have not yet found the specific prj.conf file used by the ble_app_uart example, although I note that sdk_config.h has numerous defines and would appear to make a separate prj.conf file unnecessary. Can anyone advise where I could expect to find the appropriate prj.conf file for the ble_app_uart project or is there a change in the sdk_config.h file I should be making ?

I am running the SEGGER Embedded Studio for ARM, Release 7.32 Build 2023081802.53976, Linux x64

Thanks for your help ;-)

Parents
  • Hi,

    If you do not have the optional 32.768 kHz crystal on your custom board, you need to configure the application to use the internal RC oscillator.

    If you are using nRF5 SDK, this can be configured as described in this post.

    Note that prj.conf are only relevant for nRF Connect SDK samples. The older nRF5 SDK uses the sdk_config.h file for configuration.

    If you are starting a new project and want access to new features/active development, you should use the nRF Connect SDK.nRF5 SDK is only supported in maintenance mode.

    Best regards,
    Jørgen

  • Hi Jorgen,

    thanks for your prompt reply ;-)

    I updated the sdk_config.h file as per the instructions detailed in Case ID: 129248 and observed that the application still executed without problems on the evaluation kit. I programmed my custom board and verified the download was correct however still no joy when powering the custom board separately; the devices do not advertise and fail to appear in the Nordic UART mobile app. I have two prototype custom boards and both behave the same, I need to dig further into this before getting back to you.

    Jorgen your help is much appreciated,

    regards,

    Russell

  • Rather than changing parts of sdk_config.h just eclipse later definitions by adding these lines to the very start of sdk_config.h:

    // No 32kHz crystal
    #define NRFX_CLOCK_CONFIG_LF_SRC         0
    #define CLOCK_CONFIG_LF_SRC              0
    #define NRF_SDH_CLOCK_LF_SRC             0
    #define NRF_SDH_CLOCK_LF_RC_CTIV        16
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV    2
    #define NRF_SDH_CLOCK_LF_ACCURACY        1 // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM

    Make sure it is the correct .h file; some projects have sdk_config.h in the same directory as main.c and others in the config directory for the specific IDE used to build the project

  • Hi HMolesworth,

    Thanks for that suggestion, it does simplify changing the config file. I incorporated the define statements at the start of the sdk_config.h file and re-compiled, downloaded and verified the executable. To double check, I made the changes to the blinky_pca1040_s112 project since I have two of the same GPIO pins driving LED's on my custom pcb. I verified the sdk_config.h file was in the parent example config directory and noted the application ran without problems on the development kit. As with the previous attempts, whilst the program verifies OK on the custom pcb, the application does not run, LED's were not driven (active LOW), no activity was noted. I manually triggered a short to gnd on the RESET pin without any change in activity. As I mentioned before, both prototype custom boards gave the same results.

    Since I have a bare-bones custom pcb, one possibility is that the application may be expecting certain inputs present on the eval kit pcb but not present on the custom pcb. The app could then be sitting in an endless loop waiting for input. Is that a possibility ?

    In any case, I intend to create the simplest app possible and see if that will run.

    Thanks again for your help, I really appreciate it.

  • The BMD-300 series usually is shipped with a Bootloader installed; before anything like these Apps will work that needs to be erased with the EraseAll command. That can be done via Segger IDE or nRFJprog. If a recent BMD-300 v3 silicon then Approtect needs releasing before even an erase can be performed, ie do a Recover.

    If using nRFJprog try something like this:

     set path=%path%;C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin
     nrfjprog --version
      nrfjprog version: 10.9.0
      JLinkARM.dll version: 7.66a
    Detect what board/chip is detected:
     nrfjprog --deviceversion
      NRF52832_xxAA_REV1
     nrfjprog --recover
     nrfjprog -f NRF52 --eraseall
     nrfjprog --program s132_nrf52_5.1.0_softdevice.hex --sectorerase --log --verify
     nrfjprog --verify s132_nrf52_5.1.0_softdevice.hex
      Parsing hex file.
      Verifying programming.
      Verified OK.
    nrfjprog --program some_example.hex --verify

    Edit: Note the Softdevice should be programmed before the App if using command-line tools

    'nother Edit: These are defined pins, depends on boards.h setting so might have to handle pushbuttons if enabled, best just to make a specific boards file which either has no buttons or set them to known state:

    main.c
     Directory of .\nRF5_SDK_17.1.0\examples\ble_peripheral\ble_app_uart
            .rx_pin_no    = RX_PIN_NUMBER,
            .tx_pin_no    = TX_PIN_NUMBER,
            .rts_pin_no   = RTS_PIN_NUMBER,
            .cts_pin_no   = CTS_PIN_NUMBER,
    
     Directory of .\nRF5_SDK_17.1.0\components\boards
    pca10040.h
    #define BUTTON_PULL    NRF_GPIO_PIN_PULLUP
    #define RX_PIN_NUMBER  8
    #define TX_PIN_NUMBER  6
    #define CTS_PIN_NUMBER 7
    #define RTS_PIN_NUMBER 5
    #define SPIS_MISO_PIN   28  // SPI MISO signal.
    #define SPIS_CSN_PIN    12  // SPI CSN signal.
    #define SPIS_MOSI_PIN   25  // SPI MOSI signal.
    #define SPIS_SCK_PIN    29  // SPI SCK signal.
    #define SPIM0_SCK_PIN   29  // SPI clock GPIO pin number.
    #define SPIM0_MOSI_PIN  25  // SPI Master Out Slave In GPIO pin number.
    #define SPIM0_MISO_PIN  28  // SPI Master In Slave Out GPIO pin number.
    #define SPIM0_SS_PIN    12  // SPI Slave Select GPIO pin number.
    #define SPIM1_SCK_PIN   2   // SPI clock GPIO pin number.
    #define SPIM1_MOSI_PIN  3   // SPI Master Out Slave In GPIO pin number.
    #define SPIM1_MISO_PIN  4   // SPI Master In Slave Out GPIO pin number.
    #define SPIM1_SS_PIN    5   // SPI Slave Select GPIO pin number.
    #define SPIM2_SCK_PIN   12  // SPI clock GPIO pin number.
    #define SPIM2_MOSI_PIN  13  // SPI Master Out Slave In GPIO pin number.
    #define SPIM2_MISO_PIN  14  // SPI Master In Slave Out GPIO pin number.
    #define SPIM2_SS_PIN    15  // SPI Slave Select GPIO pin number.
    #define SER_APP_RX_PIN              23    // UART RX pin number.
    #define SER_APP_TX_PIN              24    // UART TX pin number.
    #define SER_APP_CTS_PIN             2     // UART Clear To Send pin number.
    #define SER_APP_RTS_PIN             25    // UART Request To Send pin number.
    #define SER_APP_SPIM0_SCK_PIN       27     // SPI clock GPIO pin number.
    #define SER_APP_SPIM0_MOSI_PIN      2      // SPI Master Out Slave In GPIO pin number
    #define SER_APP_SPIM0_MISO_PIN      26     // SPI Master In Slave Out GPIO pin number
    #define SER_APP_SPIM0_SS_PIN        23     // SPI Slave Select GPIO pin number
    #define SER_APP_SPIM0_RDY_PIN       25     // SPI READY GPIO pin number
    #define SER_APP_SPIM0_REQ_PIN       24     // SPI REQUEST GPIO pin number
    #define SER_CON_RX_PIN              24    // UART RX pin number.
    #define SER_CON_TX_PIN              23    // UART TX pin number.
    #define SER_CON_CTS_PIN             25    // UART Clear To Send pin number. Not used if HWFC is set to false.
    #define SER_CON_RTS_PIN             2     // UART Request To Send pin number. Not used if HWFC is set to false.
    #define SER_CON_SPIS_SCK_PIN        27    // SPI SCK signal.
    #define SER_CON_SPIS_MOSI_PIN       2     // SPI MOSI signal.
    #define SER_CON_SPIS_MISO_PIN       26    // SPI MISO signal.
    #define SER_CON_SPIS_CSN_PIN        23    // SPI CSN signal.
    #define SER_CON_SPIS_RDY_PIN        25    // SPI READY GPIO pin number.
    #define SER_CON_SPIS_REQ_PIN        24    // SPI REQUEST GPIO pin number.
    #define SER_CONN_CHIP_RESET_PIN     11    // Pin used to reset connectivity chip
    // Arduino board mappings
    #define ARDUINO_SCL_PIN             27    // SCL signal pin
    #define ARDUINO_SDA_PIN             26    // SDA signal pin
    #define ARDUINO_AREF_PIN            2     // Aref pin
    #define ARDUINO_13_PIN              25    // Digital pin 13
    #define ARDUINO_12_PIN              24    // Digital pin 12
    #define ARDUINO_11_PIN              23    // Digital pin 11
    #define ARDUINO_10_PIN              22    // Digital pin 10
    #define ARDUINO_9_PIN               20    // Digital pin 9
    #define ARDUINO_8_PIN               19    // Digital pin 8
    #define ARDUINO_7_PIN               18    // Digital pin 7
    #define ARDUINO_6_PIN               17    // Digital pin 6
    #define ARDUINO_5_PIN               16    // Digital pin 5
    #define ARDUINO_4_PIN               15    // Digital pin 4
    #define ARDUINO_3_PIN               14    // Digital pin 3
    #define ARDUINO_2_PIN               13    // Digital pin 2
    #define ARDUINO_1_PIN               12    // Digital pin 1
    #define ARDUINO_0_PIN               11    // Digital pin 0
    #define ARDUINO_A0_PIN              3     // Analog channel 0
    #define ARDUINO_A1_PIN              4     // Analog channel 1
    #define ARDUINO_A2_PIN              28    // Analog channel 2
    #define ARDUINO_A3_PIN              29    // Analog channel 3
    #define ARDUINO_A4_PIN              30    // Analog channel 4
    #define ARDUINO_A5_PIN              31    // Analog channel 5

  • Just an update to confirm correct functioning of the custom pcb's. I built a third custom PCB and plugged this into my host system (not the eval dk) and could find the device advertising as "RigCom". So it shows the BMD-300 module running OK and advertising prior to programming. So it appears I have a configuration problem in the software that is preventing the device from either launching code or from advertising.

  • Hi HMolesworth,

    success !

    I used SES to "erase all", recompiled and downloaded the file and now my custom PCB is advertising ;-)

    thanks so much for your help !

    regards,

    Russell

Reply Children
Related