Hi.
I am trying to using standard SDK to develop my RTL8720DN. But when I trying to config wifi, it shows hard fault error as following:
I am using the script scenario 5 in example_wlan_scenario.
Thanks if anyone can give some help.
Hi @adadadd,
Looking at the readme.txt for the example, it seems like the RTL8720DN is not supported, since AmebaD is not listed in the support list at the bottom.
Is there a specific reason you want to run scenario 5? the simpler way to connect to WiFi would be to use the AT commands ATW0=<ssid>, ATW1=<pass>, ATWC
Hi
Thanks for your advice. Actually, I saved the script in \project\realtek_amebaD_va0_example\src\src_hp/main.c. So, the problem is I cannot initialize WiFi by using wifi_on api. I think AmebaD should support it.
What do you mean by WiFi cannot initialize using wifi_on api? Testing with the standard SDK, connecting to wifi seems to work fine
How do you do the definition? I think I do not define somethings. Here is my scirpt.
#include <platform_opts.h>
#include "FreeRTOS.h"
#include "task.h"
#include <platform/platform_stdlib.h>
#include <lwip_netconf.h>
#include "wifi_constants.h"
#include "wifi_structures.h"
#include "lwip_netconf.h"
#include "wifi_conf.h"
#include "dhcp/dhcps.h"
#if CONFIG_LWIP_LAYER
extern struct netif xnetif[NET_IF_NUM];
#endif
#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
static rtw_result_t scan_result_handler(rtw_scan_handler_result_t* malloced_scan_result);
static rtw_result_t scan_result_RSSI_handler(rtw_scan_handler_result_t* malloced_scan_result);
char *ssid;
char *password;
extern int error_flag;
void main()
{
DBG_ERR_MSG_ON(MODULE_MISC);
wifi_on(RTW_MODE_STA);
}
looking at the code, it seems like wifi_on requires that the rtos is started first. Doing this seems to work:
void init(void *param)
{
wifi_on(RTW_MODE_STA);
vTaskDelete(NULL);
}
int main(void)
{
xTaskCreate(init, ((const char*)"init"), 512 + 768, NULL, tskIDLE_PRIORITY + 3 + PRIORITIE_OFFSET, NULL);
vTaskStartScheduler();
}
you are probably using it wrong.
Examples of how the WiFi code should be used can be seen in the ATW0, ATW1, ATWC commands in atcmd_wifi.c file from the standard SDK, as well as wifi_drv.cpp file from Arduino.