Im planning on using USB MSD and also need a huge buffer for when USB isnt used...
If i power the Device VIA USB CABLE then i want to use the USB Buffer for USB MSD STUFF
if i power the device VIA external POWER then i want to use the USB buffer for something else...
How can i create another variable to overlap on USB MSD buffer space ?
Im planning on using USB MSD and also need a huge buffer for when USB isnt used...
If i power the Device VIA USB CABLE then i want to use the USB Buffer for USB MSD STUFF
if i power the device VIA external POWER then i want to use the USB buffer for something else...
How can i create another variable to overlap on USB MSD buffer space ?
If you mean the 512 byte dataBuffer/FATBuffer. The easiest way to use it would be to create a struture type for your data, create a pointer of that data stucture type and assign the address of the buffer memory you want to use to that pointer. I have not looked at the MSD code but I would guess if you don't use the functions it's internal data buffer memory location should still be free to read or write by other processes.
ok having enough space isnt the issue i found out... what could cause this problem with SPRINTF ?
Code:
while(1) //FOREVER LOOP
{
getstr_uart(Rxdata,5); //GET 5 CHARACTERS ... WORKS as you can see in image
memset(TxStr,0,20); //Clears the buffer (works)
sprintf(TxStr, "Hello %s!\n\r\0",Rxdata); //[B] THIS SETS THE ENTIRE BUFFER TO 0xFF [/B]
str2uart(TxStr); //Usually works but jumps out and turns on some leds for some reason...
}
What happens without the memset(); command?... I'm just wondering if the function is some how changing the pointer to a rom pointer. as that would cause this effect..
ok my combined code is huge... mainly becase I have ELM CHAN FATFS in this project... when i remove all the FATFS files it works! but when i add the files back it doesnt... even if i dont call any of the functions from fatfs stuff. I dont even have to INCLUDE them... if they are in the project at all it doesnt work. If i remove them from project its ok... WTF!