shine Posted February 5, 2008 Share Posted February 5, 2008 (edited) Hi, I've just download dswifi to do some attempts on ds coding.I first downloaded the examples and worked perfectly on my AP, wifi_lib_test.nds works great and I think everything is ok (both on emulators and real hardware).Then I tried to compile the file for myself; after very little and non important tweak, it compiles with no errors but when running on both DS or emulators, it never gets out of this loop: while(Wifi_CheckInit()==0) { // wait for arm7 to be initted successfully while(VCOUNT>192); // wait for vblank while(VCOUNT<192); } I've tried compiling both wifi_lib_test and wifi_example1, but I get the same problem on both samples.As the examples are from version 0.3a but devKitPro installed 0.3.4, maybe there is any internal function that is different and doesn't work the same way?To reduce the scope, I also replaced libraries 0.3.4 to 0.3a, but the problem still was present. So maybe is a problem with the current libnds/devkitpro libraries?Any hint? Thanks in advance and congrats for this great library Edit:I've also downloaded PAlib and test if it works there, but I got the same problem: it hangs in PA_ConnectWifiWFC. Looking at source code I see it's the same code as above, so it seems Wifi_CheckInit is always returning 0. Edited February 6, 2008 by shine Link to comment Share on other sites More sharing options...
Wilsom Posted February 10, 2008 Share Posted February 10, 2008 Hi There, Yes I have exactly the same issue been over the code many times and from the exmaples seems to be the same issue. All the BestMike Hi, I've just download dswifi to do some attempts on ds coding.I first downloaded the examples and worked perfectly on my AP, wifi_lib_test.nds works great and I think everything is ok (both on emulators and real hardware).Then I tried to compile the file for myself; after very little and non important tweak, it compiles with no errors but when running on both DS or emulators, it never gets out of this loop: while(Wifi_CheckInit()==0) { // wait for arm7 to be initted successfully while(VCOUNT>192); // wait for vblank while(VCOUNT<192); } I've tried compiling both wifi_lib_test and wifi_example1, but I get the same problem on both samples.As the examples are from version 0.3a but devKitPro installed 0.3.4, maybe there is any internal function that is different and doesn't work the same way?To reduce the scope, I also replaced libraries 0.3.4 to 0.3a, but the problem still was present. So maybe is a problem with the current libnds/devkitpro libraries?Any hint? Thanks in advance and congrats for this great library Edit:I've also downloaded PAlib and test if it works there, but I got the same problem: it hangs in PA_ConnectWifiWFC. Looking at source code I see it's the same code as above, so it seems Wifi_CheckInit is always returning 0. Link to comment Share on other sites More sharing options...
Wilsom Posted February 11, 2008 Share Posted February 11, 2008 Here is my test code .... I dont think its in the code but anyway...all coding examples are hanging at wifi-checkinit(); ------------------------cut----------------------- #include <nds.h>#include <dswifi9.h>#include <sys/socket.h>#include <netinet/in.h>#include <netdb.h>#include <stdio.h> #define VCOUNT (*((u16 volatile *) 0x04000006)) void initGraphics(){ videoSetMode(0); videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE);vramSetBankC(VRAM_C_SUB_BG); SUB_BG0_CR = BG_MAP_BASE(31); BG_PALETTE_SUB[255] = RGB15(31,31,31);consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31),(u16*)CHAR_BASE_BLOCK_SUB(0), 16);} void Timer_50ms(void) { Wifi_Timer(50);} void arm9_synctoarm7() { REG_IPC_FIFO_TX = 0x87654321;} void arm9_fifo() { u32 value = REG_IPC_FIFO_RX; if ( value == 0x87654321 ) Wifi_Sync();} int main(void) { initGraphics(); iprintf("Start Main\n"); { REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR; u32 Wifi_pass= Wifi_Init(WIFIINIT_OPTION_USELED); REG_IPC_FIFO_TX = 0x12345678; REG_IPC_FIFO_TX = Wifi_pass; *((volatile u16 *)0x0400010E) = 0; irqInit(); irqSet(IRQ_TIMER3, Timer_50ms); irqEnable(IRQ_TIMER3); irqSet(IRQ_FIFO_NOT_EMPTY, arm9_fifo); irqEnable(IRQ_FIFO_NOT_EMPTY); REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_RECV_IRQ; Wifi_SetSyncHandler(arm9_synctoarm7); // Timer3 ???? *((volatile u16 *)0x0400010C) = -6553; // 6553.1 * 256 cycles = ~50ms; *((volatile u16 *)0x0400010E) = 0x00C2; // enable, irq, 1/256 clock iprintf("Wifi Check init start \n"); while ( Wifi_CheckInit() == 0 ) { while(VCOUNT>192); while(VCOUNT<192); } } iprintf("WiFi Initiated\n"); { int i; Wifi_AutoConnect(); while(1) { i = Wifi_AssocStatus(); if ( i == ASSOCSTATUS_ASSOCIATED ) { iprintf("Associated\n"); break; } if ( i == ASSOCSTATUS_CANNOTCONNECT ) { iprintf("Can Not Connect\n"); break; } } } while(1) { swiWaitForVBlank(); } return 0;} Link to comment Share on other sites More sharing options...
colintoal Posted August 8, 2008 Share Posted August 8, 2008 Here is my test code .... I dont think its in the code but anyway...all coding examples are hanging at wifi-checkinit(); ------------------------cut----------------------- #include <nds.h>#include <dswifi9.h>#include <sys/socket.h>#include <netinet/in.h>#include <netdb.h>#include <stdio.h> #define VCOUNT (*((u16 volatile *) 0x04000006)) void initGraphics(){ videoSetMode(0); videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE);vramSetBankC(VRAM_C_SUB_BG); SUB_BG0_CR = BG_MAP_BASE(31); BG_PALETTE_SUB[255] = RGB15(31,31,31);consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31),(u16*)CHAR_BASE_BLOCK_SUB(0), 16);} void Timer_50ms(void) { Wifi_Timer(50);} void arm9_synctoarm7() { REG_IPC_FIFO_TX = 0x87654321;} void arm9_fifo() { u32 value = REG_IPC_FIFO_RX; if ( value == 0x87654321 ) Wifi_Sync();} int main(void) { initGraphics(); iprintf("Start Main\n"); { REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_SEND_CLEAR; u32 Wifi_pass= Wifi_Init(WIFIINIT_OPTION_USELED); REG_IPC_FIFO_TX = 0x12345678; REG_IPC_FIFO_TX = Wifi_pass; *((volatile u16 *)0x0400010E) = 0; irqInit(); irqSet(IRQ_TIMER3, Timer_50ms); irqEnable(IRQ_TIMER3); irqSet(IRQ_FIFO_NOT_EMPTY, arm9_fifo); irqEnable(IRQ_FIFO_NOT_EMPTY); REG_IPC_FIFO_CR = IPC_FIFO_ENABLE | IPC_FIFO_RECV_IRQ; Wifi_SetSyncHandler(arm9_synctoarm7); // Timer3 ???? *((volatile u16 *)0x0400010C) = -6553; // 6553.1 * 256 cycles = ~50ms; *((volatile u16 *)0x0400010E) = 0x00C2; // enable, irq, 1/256 clock iprintf("Wifi Check init start \n"); while ( Wifi_CheckInit() == 0 ) { while(VCOUNT>192); while(VCOUNT<192); } } iprintf("WiFi Initiated\n"); { int i; Wifi_AutoConnect(); while(1) { i = Wifi_AssocStatus(); if ( i == ASSOCSTATUS_ASSOCIATED ) { iprintf("Associated\n"); break; } if ( i == ASSOCSTATUS_CANNOTCONNECT ) { iprintf("Can Not Connect\n"); break; } } } while(1) { swiWaitForVBlank(); } return 0;} I'm having the same problem with latest DevKitPro and dswifilib -- the example and test app hang at 'initializing ARM7' -- it looks like the IPC is broken and I thought it might have something to do with the latest devkitPro - but I haven't had a chance to debug through it yet. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now