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

Project won't download

I am having issues with the pin_change_int example. I have not changed anything to the code, but it will not load onto my board. In fact, pressing load in this project doesn't even erase the flash because when I try to load it, the same old program keeps running. If I manually clear the flash and then try to load, it says it loaded successfully, but nothing works (I'm assuming LED1 is supposed to turn on when BUTTON1 is pressed). 

  • I think something in these functions is the critical issue because I copied and pasted them into a working project and now that project will not load onto the board.

    void in_pin_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
        nrf_drv_gpiote_out_toggle(PIN_OUT);
    }
    
    /**
     * @brief Function for configuring: PIN_IN pin for input, PIN_OUT pin for output, 
     * and configures GPIOTE to give an interrupt on pin change.
     */
    static void gpio_init(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_drv_gpiote_init();
        APP_ERROR_CHECK(err_code);
        
        nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);
    
        err_code = nrf_drv_gpiote_out_init(PIN_OUT, &out_config);
        APP_ERROR_CHECK(err_code);
    
        nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);
        in_config.pull = NRF_GPIO_PIN_PULLUP;
    
        err_code = nrf_drv_gpiote_in_init(PIN_IN, &in_config, in_pin_handler);
        APP_ERROR_CHECK(err_code);
    
        nrf_drv_gpiote_in_event_enable(PIN_OUT, true);
    }

  • Hi Aaron, 

    Please make sure the start address of the code is at address 0x000000. We have different variant, one is without softdevice (start at 0x00) and one to be used with softdevice (starts at 0x??? ). There is a chance that you flashed the variant with softdevice and that's why it didn't erase the old application. 

     

Related