#139070 - Mighty Max - Sat Sep 01, 2007 1:46 pm
Hello,
i didn't do anything DS related for a long time now, but started something yesterday again, and stumbled directly over some weirdness.
devkitPro was updated via the updater on the 30.8.
The arm7 is on hold, the arm9 executes the main() and irq's are disabled to ensure it is not messing with the problem.
is the particular part that fails:
It's output:
As you may notice the "to 0" is obviously wrong. But the values it was created from were correct. newQ->buffer is in the uncached mem area, i=0 and sizeof(MESSAGEBUFFER) is 0x14. It seems that newQ->buffer gets overwritten.
Declaring them as volatile showed that the problem persists, so i am relatively sure that i don't have just messed up registers.
When commenting out the firts two printfs the first "from ... to ..." line is calculated correct, and the failure starts in the second line. (After the first (i)printf is called)
the console has init before calling this routine by
So my question:
Is there a known problem recently in the (i)printf functions or does anyone see an error that could cause this.
:edit1:
Problem does not occure when using the cached mirror of memory. Probably a timing issue?
:edit2:
Turned out to be some arbitary data flushed the cachline overwriting the data i had just written to the uncached version.
_________________
GBAMP Multiboot
i didn't do anything DS related for a long time now, but started something yesterday again, and stumbled directly over some weirdness.
devkitPro was updated via the updater on the 30.8.
The arm7 is on hold, the arm9 executes the main() and irq's are disabled to ensure it is not messing with the problem.
Code: |
[in CreateMessageQueue after some small mallocs] printf(" buffer = %X\n",newQ->buffer) ; printf(" entries = %X\n",newQ->numEntries) ; for (i=0;i<maxMessages;i++) { LPMESSAGEBUFFER mb = (LPMESSAGEBUFFER)(((unsigned long)newQ->buffer) + i * sizeof(MESSAGEBUFFER)) ; printf("from %X to %X\n",(((unsigned long)fullData) + i * maxMessageSize),mb) ; } printf("returning\n") ; |
is the particular part that fails:
It's output:
Code: |
buffer = 2413838 entries = 0 from 2411120 to 0 from 24118F0 to 14 ... |
As you may notice the "to 0" is obviously wrong. But the values it was created from were correct. newQ->buffer is in the uncached mem area, i=0 and sizeof(MESSAGEBUFFER) is 0x14. It seems that newQ->buffer gets overwritten.
Declaring them as volatile showed that the problem persists, so i am relatively sure that i don't have just messed up registers.
When commenting out the firts two printfs the first "from ... to ..." line is calculated correct, and the failure starts in the second line. (After the first (i)printf is called)
the console has init before calling this routine by
Code: |
int main(void) { REG_EXMEMCNT=0xe800; powerON(POWER_ALL); REG_IME = 0 ; REG_IE = 0 ; REG_IF = 0xFFFF ; videoSetMode(0); //not using the main screen videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); //sub bg 0 will be used to print text vramSetBankC(VRAM_C_SUB_BG); SUB_BG0_CR = BG_MAP_BASE(31); BG_PALETTE_SUB[255] = RGB15(31,31,31); //by default font will be rendered with color 255 //consoleInit() is a lot more flexible but this gets you up and running quick consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16); defaultExceptionHandler() ; printf("Starting up...\n"); mq7to9 = CreateMessageQueue(5,2000) ; mq9to7 = CreateMessageQueue(5,2000) ; printf(" Queue 7to9: @%08X\n",mq7to9) ; printf(" Queue 9to7: @%08X\n",mq9to7) ; |
So my question:
Is there a known problem recently in the (i)printf functions or does anyone see an error that could cause this.
:edit1:
Problem does not occure when using the cached mirror of memory. Probably a timing issue?
:edit2:
Turned out to be some arbitary data flushed the cachline overwriting the data i had just written to the uncached version.
_________________
GBAMP Multiboot