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

Nrf51822 and STM32 uart bootloader problem

Hello

I try to use this bootloader https://github.com/williamhuang03/STM32F4-Custom-Bootloader on STM32F4 which works well through cable but as suddenly I use Nfr51 as transmitter and ESP32 as receiver so it doesn't work problem is that STM32 bootloader sends these commands in hex format #define ACK 0x06U, #define NACK 0x16U which Nrf51 uart rx ignores. Can mini advise where can be the problem ? I use the standard ble_app_uart code that is included with SDK_8.0.0 thank you for your advice.

Parents
  • Just to calrify: You have a STM32F sends UART commands to the nRF51 running the ble_app_uart example, which in turn sends these over BLE to a ESP32?

    I think that the ble_app_uart example expects the '\n' character to be received before sending the string received over UART on BLE. 

    Best regards

    Bjørn 

  • Exactly, I tried to add an '\ n' update to the STM32 boot code, but I get an error while updating. I Have tested this modified code with FTDI usb and the update will succeed.

    static void Send_ACK(UART_HandleTypeDef *handle)
    {
        uint8_t msg[2] = {ACK, '\n'};
        
        HAL_UART_Tx(handle, msg, 2);
    }
    
    /*! \brief Sends an NACKnowledge byte to the host.
     *  
     *  \param  *UartHandle The UART handle
     */
    static void Send_NACK(UART_HandleTypeDef *handle)
    {
        uint8_t msg[2] = {NACK, '\n'};
        
        HAL_UART_Tx(handle, msg, 2);
    }

Reply
  • Exactly, I tried to add an '\ n' update to the STM32 boot code, but I get an error while updating. I Have tested this modified code with FTDI usb and the update will succeed.

    static void Send_ACK(UART_HandleTypeDef *handle)
    {
        uint8_t msg[2] = {ACK, '\n'};
        
        HAL_UART_Tx(handle, msg, 2);
    }
    
    /*! \brief Sends an NACKnowledge byte to the host.
     *  
     *  \param  *UartHandle The UART handle
     */
    static void Send_NACK(UART_HandleTypeDef *handle)
    {
        uint8_t msg[2] = {NACK, '\n'};
        
        HAL_UART_Tx(handle, msg, 2);
    }

Children
Related