wifi da16200 NOT HTTP CLIENT EXAMPLE NOT WORK

Hy im using your exemple code RA6M4_DA16200_HTTP_CLIENT  at following link https://www.renesas.com/us/en/products/interface-connectivity/wireless-communications/wi-fi/low-power-wi-fi/da16200mod-ultra-low-power-wi-fi-modules-battery-powered-iot-devices#design_development.

Im using Board RA2L1, i have adapted code to this boars, i can connect with my personal wifi with your DA16200 but im not able to send data over wifi, but I'm able to connect at my wifi and sync data and time.

This is a part of your code, when your exemple go in this section just feze forever.

Reading your documentation i need first to send AT+NWHTC=1, if correct this AT+NWHTC=1 i think that is not present in your exemple code.

Can you suggest me a simple way to enable data send over wifi or how to unlock your example ? Or can you fix your example code ?

  • Hi Boris,

    Thank you for posting your question online.
    We are currently working on this example to test if there is a problem with the code.
    This example is based on RA6M4, there is not an example for RA2L1 and DA16200. Can you share any modifications you have made on your RA2L1 board?

    Kind Regards,
    OV_Renesas

  • Hy thank you for support, I have upload all my project in a github repository, in this way I Will share all my mod at comunity.

    this is my repo with project source code -->  https://github.com/P992/RA2L1_DA1600_HTTP_TEST

    I have connected DA16200 at pmod 2 connector in RA2L1. Later I'have used a FT232RL serial connector to connect Serial debug DA16200 to host pc, in this way with tera term I'm able to see the DA16200 status.

    Host Pc and Da16200 are connected at the same wifi line, i have launched your python code in example based on RA6M4

    In particular i have modfied the code to "stress" the http send request, in official example we need to press switch, in my code this is continuos loop of http send.

    This is the out view of RTT client, and the code freze forever

    I would like to use http GET  to populate a thingspeak dashboard with measured data.

    Thank you again.

     

  • Hi Boris,

    We used your code to run the example on a RA2L1 and indeed there is an issue on the http send request.
    I am currently working on this, and I will get back to you as soon as possible.

    Kind Regards,
    OV_Renesas

  • Hi and thanks for the support, as soon as possible I'd like to understand what I did wrong. Thanks again

  • Hi Boris,

    Sorry for the late response. 
    We are able to run the example on RA6M4 and everything works fine. 
    When we tried your code for RA2L1 we were facing the issue you stated. 
    The reason is that when you call:

    err = wifi_http_client_send_data(http_server_ip,data_to_server,send_cnt);   /* Send steam data to HTTP server */
    

    You will go on wifi_http_client_send_data function which is on da16200_AT.c file:
    /************************************************************************************
    * Name:       wifi_http_client_send_data
    * Function:   1ms callback
    * Parameters: p_args
    * Return:     1ms timing
    ************************************************************************************/
    fsp_err_t wifi_http_client_send_data(char *server_ip, char *data_to_send,uint8_t num)
    {
        fsp_err_t status = FSP_SUCCESS;
        uint8_t atcmd_buffer[MAX_LEN_TRANSMIT];
        uint8_t num_buffer[5];
    
        memset(atcmd_buffer, 0, MAX_LEN_TRANSMIT);
        /* Joint the string for NWHTC command: "AT+NWHTC=URL,POST,data content\r\n" */
        strcat((char *)atcmd_buffer, (char *)"AT+NWHTC=http://");
        strcat((char *)atcmd_buffer, (char *)server_ip);
        strcat((char *)atcmd_buffer, (char *)":5000/mock,post,");
        strcat((char *)atcmd_buffer, (char *)data_to_send);
        strcat((char *)atcmd_buffer, (char *)" / number is ");
        sprintf((char *)num_buffer,"%d",num);
        strcat((char *)atcmd_buffer, (char *)num_buffer);
        strcat((char *)atcmd_buffer, (char *)"\r\n");
        g_da16200_cmd_set[DA16200_AT_CMD_INDEX_AT_NWHTC].p_cmd = atcmd_buffer;
        status = wifi_command_AT_NWHTC();
        if(status != FSP_SUCCESS)
        {
            return status;
        }
        return status;
    }
    

    When we try to fill the atcmd_buffer with 0s via memset we keep getting an NMI interrupt and we end up on bsp_group_irq.c file:
    /*******************************************************************************************************************//**
     * Non-maskable interrupt handler. This exception is defined by the BSP, unlike other system exceptions, because
     * there are many sources that map to the NMI exception.
     **********************************************************************************************************************/
    void NMI_Handler (void)
    {
        uint16_t nmisr = R_ICU->NMISR;
    
        /* Loop over all NMI status flags */
        for (bsp_grp_irq_t irq = BSP_GRP_IRQ_IWDT_ERROR; irq <= BSP_GRP_IRQ_CACHE_PARITY; irq++)
        {
            /* If the current irq status register is set call the irq callback. */
            if (0U != (nmisr & (1U << irq)))
            {
                (void) bsp_group_irq_call(irq);
            }
        }
    
        /* Clear status flags that have been handled. */
        R_ICU->NMICLR = nmisr;
    }

    We are still working on this on why this NMI occurs and how we can fix this. 

    Kind Regards,
    OV_Renesas

  • Thank you very much. If I find another way to fix it I will share it with comunity

  • Hi Boris,

    Apologies for the delay.
    The reason you were getting an NMI interrupt was due to Stack Overflow.
    You should go on FSP Configurations--> configurations.xml -->BSP -->Properties


    and set your
    Main Stack Size: 0x2000
    Heap Size: 0x1000

    After this changes you will not get again an NMI interrupt and your example should run.

    Kind Regards,
    OV_Renesas

  • Hy I  tried this setup and everything work well. Thank you for support