colintoal
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Events
Forums
Blogs
Downloads
Posts posted by colintoal
-
-
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.
-
It will eventually make it's way to a more accessable location, but for now the lib test source can be downloaded from:
http://devkitpro.org/files/wifi_lib_test.zip
Also, the other example project (wifi_example1) is at:
http://akkit.org/dswifi/wifi_example1_r20.zip
Have fun
Hi - I got the source from the above location and tried to build it using the latest devkitPro on Ubuntu. It build fine after I fixed a minor problem with the case sensitivity of the pathing to ASCII.bin in data. But - when I try this in both desmume-cli AND on my DS (using M3 DS Real card), it hangs at 'Waiting for ARM7 to init...'
Any idea of what I am doing wrong ? I'm going to try this on an early rev of devkitPro to see if it helps - but any other suggestions would be welcome before I debug through it.
Colin
dswifi tests
in DS Hacks [/ds]
Posted
Any chance this -O2 switch is the reason why I can't get dswifi_lib_test built from source in the current devkitPro to work on my DS ?
I mean - if -O2 is the culprit, I'll grep and fix all my makefiles, but it makes me wonder why -O2 is on to begin with. It breaks debugging in Eclipse with GDB for me (none of the lines are actually in the right spot) AND it breaks ds_wifi_lib ?