Patching __cfg_sdspi_config1 with 00000000
Little-endian
Posts: 91
To make a long story short I was having some issues trying to get SD card I/O working in a new propeller project I'm working on. I've never used SD card I/O so some issues and learning experiences are to be expected. I did read up on implementing SD card I/O searching previous forum threads as well as the learn pages. After some issues, I went back and tested the included learn examples and get the "Patching __cfg_sdspi_config1 with 00000000" messages below. SD Minimal does run however, and I do get the correct output in the terminal window.
Are these messages normal? Should the SD Minimal example consume 17860 bytes?
I did just upgrade yesterday to Simple IDE v1.0.2 (RC2)
For my other project it hangs when I include the "sd_mount(DO, CLK, DI, CS); " line in my program. I comment out this line and it runs w/o SD I/O, of course. I'm wording if this issue is causing the issues I'm experiencing with my other application.
propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2408)
propeller-elf-gcc.exe -I . -L . -I C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/cmm/ -I C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext -L C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext/cmm/ -I C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/cmm/ -o cmm/SD Minimal (1).elf -Os -mcmm -m32bit-doubles -fno-exceptions -std=c99 SD Minimal (1).c -lm -lsimpletools -lsimpletext -lsimplei2c -lm -lsimpletools -lsimpletext -lm -lsimpletools -lm
propeller-load -s cmm/SD Minimal (1).elf
Patching __cfg_sdspi_config1 with 00000000
Patching __cfg_sdspi_config2 with 00000000
propeller-elf-objdump -h cmm/SD Minimal (1).elf
Done. Build Succeeded!
propeller-load.exe -Dreset=dtr -I C:/Program Files/SimpleIDE/bin/../propeller-gcc/propeller-load/ cmm/SD Minimal (1).elf -r -p COM13
Propeller Version 1 on COM13
Patching __cfg_sdspi_config1 with 00000000
Loading cmm/SD Minimal (1).elf to hub memory
17860 bytes sent
Verifying RAM ...
OK
Are these messages normal? Should the SD Minimal example consume 17860 bytes?
I did just upgrade yesterday to Simple IDE v1.0.2 (RC2)
For my other project it hangs when I include the "sd_mount(DO, CLK, DI, CS); " line in my program. I comment out this line and it runs w/o SD I/O, of course. I'm wording if this issue is causing the issues I'm experiencing with my other application.
propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2408)
propeller-elf-gcc.exe -I . -L . -I C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/cmm/ -I C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext -L C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext/cmm/ -I C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L C:/Documents and Settings/me/My Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/cmm/ -o cmm/SD Minimal (1).elf -Os -mcmm -m32bit-doubles -fno-exceptions -std=c99 SD Minimal (1).c -lm -lsimpletools -lsimpletext -lsimplei2c -lm -lsimpletools -lsimpletext -lm -lsimpletools -lm
propeller-load -s cmm/SD Minimal (1).elf
Patching __cfg_sdspi_config1 with 00000000
Patching __cfg_sdspi_config2 with 00000000
propeller-elf-objdump -h cmm/SD Minimal (1).elf
Done. Build Succeeded!
propeller-load.exe -Dreset=dtr -I C:/Program Files/SimpleIDE/bin/../propeller-gcc/propeller-load/ cmm/SD Minimal (1).elf -r -p COM13
Propeller Version 1 on COM13
Patching __cfg_sdspi_config1 with 00000000
Loading cmm/SD Minimal (1).elf to hub memory
17860 bytes sent
Verifying RAM ...
OK
Comments
I just looked in my c:\Program Files\SimpleIDE\propeller-gcc\propeller-load\ directory and don't see anything named generic there either.
I've only started using SimpleIDE recently and choose GENERIC when I started since nothing else on the list appeared to be a better match for the PPDB.
On another note, I've been able to narrow down the specific line that's causing my program to hang. I'm using two 7700 byte character arrays and a few other much smaller character arrays.
These are defined in my main() function and I then initialize them using memset: memset(&msgBuf[0], 0, 7700);
memset works fine on the first one an in hangs on the second one whenever sd_mount(DO, CLK, DI, CS); is included in my main function.
This was working fine and continues to work fine as long as I don't include the line: sd_mount(DO, CLK, DI, CS);
So this is where I am now, trying to figure out why this doesn't work when sd_mount(DO, CLK, DI, CS); is included. I'm either running out of memory or cannot get a enough contiguous memory for the second 7700 byte buffer. Any suggestions on how I can confirm this is the issue?
It seems that SimpleIDE no longer uses the SD pin values in the config file when building a binary, and sd_mount or dfs_mount must be called explicitly. However, I do know that the pin values in the config file are used when downloading a file to the SD card. I use this feature quite a bit, and the correct board config file must be used when performing this function.
If you have two buffers of 7,700 bytes each you are probably running out of memory. The two buffers are using almost half of the hub RAM, and your code with the file routines are probably using up the other half. As a test try reducing the size of the 7,700 buffers to something smaller to see if that works.
I'm using SimpleIDE and using the "CMM Main RAM Compact" memory model. None of the other memory models seem to work with the PPDB.
I realize two 7700 byte arrays are huge and I'm investigating ways to eliminate one of them and reduce the size of the other.
I was also wondering if there's any way I can use one of other memory models (I realize I may need to use a different board) to overcome this issue as well?
I see the overview of the memory models here: https://sites.google.com/site/propellergcc/documentation but don't fully understand all of it yet.
As a side note, I just tried compiling using the "LMM Main RAM" memory model and get the follow error:
c:/program files/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: region `hub' overflowed by 7336 bytes
So I think that explains it...I just don't get that error message when using the "CMM Main RAM Compact" memory model.