PINE64

Full Version: Wifi problem at 166Mhz
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all 
If i use RtlDuino (arduino for padi stamp) everythings works well , even SD card via SDIO

But if i try to set cpu to 166Mhz caling Init_CPU_CLK_UART with parameter 0 , which caling HalCpuClkConfig(0)

after i call WIFI.begin or WIFI.apbegin system freeze in serial log i can see Hard Fault Error (after Initializing WIFI ...  SPI)
if i set param 1 (83Mhz) everythings its work well

U can test it with example SoftAP (from ameba)

u must add this 
Code:
extern "C" {
void UserPreInit(void)
{
   Init_CPU_CLK_UART(0,38400); 
   // 0 - 166666666 Hz, 1 - 83333333 Hz, 2 - 41666666 Hz, 3 - 20833333 Hz, 4 - 10416666 Hz, 5 - 4000000 Hz
   // 6 - 200000000 Hz, 7 - 10000000 Hz, 8 - 50000000 Hz, 9 - 25000000 Hz, 10 - 12500000 Hz, 11 - 4000000 Hz
}  



at the begin in your sketch (as in another examples)
if u put 1 instead zero everything works

so where is the problem
Are you having this issue with the RtlDuino SDK or the Ameba sdk? I am slightly confused by the extern "C" block. I do have the Ameba SDK working though so I could possibly try calling the Init_CPU_CLK_UART and see what happens. You seem to have a better idea what you are doing than me, but if you think I can help let me know.
(11-13-2017, 10:00 AM)Dan Wrote: [ -> ]Are you having this issue with the RtlDuino SDK or the Ameba sdk? I am slightly confused by the extern "C" block. I do have the Ameba SDK working though so I could possibly try calling the Init_CPU_CLK_UART and see what happens. You seem to have a better idea what you are doing than me, but if you think I can help let me know.

I think it is issue RtlDuino SDK, extern C is because symbol Init_CPU_CLK_UART is C lang type and C++ linker dont know it by default this is used if u want mixed c++ and c libraries

so i can use ameba SDK but it does not support SD card on RTL8710, RtlDuino support SDio and its works
mirecta, first posts are moderated - please post just once. We are getting to the posts as fast as we can. Please read forum rules and policy.
(11-13-2017, 03:33 PM)Luke Wrote: [ -> ]mirecta, first posts are moderated - please post just once. We are getting to the posts as fast as we can. Please read forum rules and policy.

i understand i am sorry
Ok, I dont have any experience with the RtlDuino SDK, but based on your problem description I wonder if it is an issue with the RtlDuino SDK supporting clock rates that are different from the stock 83Mhz. I am not sure if anyone has experimented with overclocking and using the RtlDuino SDK.