Code flashing successful but not working!

Hello,

I am creating a new project that uses the nRF52810 as my controller, and during the development stage, I am using the PCA10040 nRF52832 development board. (I read somewhere that we can flash the nRF52810 code into the nRF52832 PCA10040 development board). My requirement is a simple LED indicator based on delay commands from an APK that uses the Nordic UART service to send and receive data. I added the timer peripheral to the ble_app_uart example project from the directory nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_uart\pca10040e\s112\ses and flashed the code onto the PCA10040 nRF52832 development board to test it. The code works perfectly.

Then I took an nRF52810 custom PCB and connected the JTAG. The board is able to detect and erase the chip. When I flash the code onto the board, the IDE shows "flash successful," but the board is not working. Are there any other conditions for flashing the code into the nRF52810 custom board? Your response is valuable.

SDK version: 17.0.2
SEGGER Embedded Studio version: 5.42a

Parents
  • Hi,

    If your custom board do not have external 32K crystal, you can try to modify these parameters in sdk_config.h

    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #ifndef NRF_SDH_CLOCK_LF_SRC
    #define NRF_SDH_CLOCK_LF_SRC 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #ifndef NRF_SDH_CLOCK_LF_RC_CTIV
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_ACCURACY
    #define NRF_SDH_CLOCK_LF_ACCURACY 1
    #endif

  • This is a good suggestion, can you try this  ?

Reply Children
  • yes  , I tried this and just modified the parameters in the sdk_config.h file, but my problem is not solved. now am able to debug using the RTT viewer, but after the advertising_start() function, I am getting a fatal error, and i think the board reboots. Are there any other modifications needed for flashing the code into the custom nRF52810 board? My biggest confusion is that the same code works perfectly on the development board.

    int main(void)
    {
        bool erase_bonds;
        int len1=0;
        char cmd=0;
        
        //uint32_t time_ticks;
        //uint32_t err_code = NRF_SUCCESS;
    
        // Initialize.
        uart_init();
        NRF_LOG_INFO("UART INTI\n");
        log_init();
        NRF_LOG_INFO("LOG INTI\n");
        timers_init();
        NRF_LOG_INFO("TIMER INTI\n");
        NRF_LOG_INFO("BEFORE ENTER BUTTONS LED INIT \n");
        buttons_leds_init(&erase_bonds);
        NRF_LOG_INFO("BUTTON LED INIT \n");
        indication_gpio_init();
        NRF_LOG_INFO(" INDICATION GPIO INIT \n");
        //ledonoff();
        //nrf_gpio_pin_set(GREEN_LED);
        //nrf_gpio_pin_set(BLUE_LED);
        //while(1)
        //{
        //    nrf_gpio_pin_clear(GREEN_LED);
        //    nrf_gpio_pin_clear(BLUE_LED);
        //    nrf_delay_ms(200);
        //    nrf_gpio_pin_set(GREEN_LED);
        //    nrf_gpio_pin_set(BLUE_LED);
    
    
    
        //}
       
        power_management_init();
        NRF_LOG_INFO(" POWER MANAGEMENT INIT \n");
        ble_stack_init();
        NRF_LOG_INFO(" BLE STACK INIT \n");
        gap_params_init();
        NRF_LOG_INFO(" GAP PARAMS INIT \n");
        gatt_init();
        NRF_LOG_INFO(" GATT INIT  \n");
        services_init();
        NRF_LOG_INFO(" SERVICE  INIT \n");
        advertising_init();
        NRF_LOG_INFO(" ADVERTISING  INIT \n");
        conn_params_init();
        NRF_LOG_INFO(" CONNECTION PARAMS INIT \n");
        // Start execution.
        #ifdef UART_DEBUG
        printf("\r\nUART started.\r\n");
        #endif
        NRF_LOG_INFO("\n uart started \n.");
        NRF_LOG_INFO("Debug logging for UART over RTT started.");
        advertising_start();
        while(1)
        {
           //printf("running inside while \n");
           nrf_delay_ms(100);
           if(ConnectionStatus==1)
           {
             //printf("ConnectionStatus=1 \n");
             nrf_delay_ms(100);
             break;
           }
       
        }
      
        printf(" exit from connection \n");
        while(1)
        {
        nrf_delay_ms(200);
        if(strlen(BLEDataBuff))
        {
         printf("enter in if\n");
         cmd= ble_processcommand(BLEDataBuff);
         ble_commandprocessing(cmd);
         nrf_delay_ms(100);
         memset(BLEDataBuff,0,sizeof(BLEDataBuff));
         printf("exit in if \n");
    
        }
    
        }

Related