Being frustrated with not being able to run my new DSO with the community software, I thought I would take a look and see if my inner geek still existed. I have made some modifications to try and support the 8M disk. I started with https://github.com/pmos69/dso203_gcc and looked at the new "factory" code.
Warning: I don't know what I'm doing, I don't know this software or hardware and have never even run the community addition. My C skills are so rusty the rust has rust. But, here is the first try. The enclosed .zip has the 3 files I changed and a .HEX file for app 3. If your brave, give it a try and lets see what works and what doesn't.
What I found: the only change that should matter is the sector size going from 512 to 4096. Files.c was hard coded to the old hardware and depends on sector size (unlike the normal C libraries). Based on comparing the new and old files I made adjustments in files.c and file.h and computed SectorSize and flash_mode the first time a file is opened (could call that from main, but I was looking for minimal dependencies to start with). So, this SHOULD still run with the old hardware.
I have never run the old version so it is a bit hard to know if it is running correctly.
This is running on the factory 1.6 "SYS". There are some changes to sys for the community version - I have not looked at those. Anyone who knows about all the dependencies may want to take a look. Perhaps the dependencies can be removed.
Other changes due to the 8M can be found in the file "FAT12c". I don't think they change anything in the application, but here they are just in case:
//-------FLASH-----W25Q64BV--------------------------------------------------//
#define FILE_BASE_8M 0x7000 // ÎļþÇø¿ªÊ¼µØÖ·
#define ROOT_BASE_8M 0x3000 // ¸ùĿ¼¿ªÊ¼µØÖ·
#define FAT_LEN_8M 0x1000
#define FAT1_BASE_8M 0x1000 // FAT1Çø¿ªÊ¼µØÖ·
#define FAT2_BASE_8M 0x2000 // FAT2Çø¿ªÊ¼µØÖ·
#define SEC_LEN_8M 0x1000 // ÉÈÇø³¤¶È
#define FAT1_SEC_8M 0x1 // FAT1ÉÈÇøÊý
#define FAT2_SEC_8M 0x1 // FAT2ÉÈÇøÊý
#define FAT_END_8M 0x7FF // Á´½Ó½áÊø
//----------------------------------------------------------------------------//
#define FILE_BASE_2M 0x8000 // ÎļþÇø¿ªÊ¼µØÖ·
#define ROOT_BASE_2M 0x4000 // ¸ùĿ¼¿ªÊ¼µØÖ·
#define FAT_LEN_2M 0x1800
#define FAT1_BASE_2M 0x1000 // FAT1Çø¿ªÊ¼µØÖ·
#define FAT2_BASE_2M 0x2800 // FAT2Çø¿ªÊ¼µØÖ·
#define SEC_LEN_2M 0x200 // ÉÈÇø³¤¶È
#define FAT1_SEC_2M 0x0C // FAT1ÉÈÇøÊý
#define FAT2_SEC_2M 0x0C // FAT2ÉÈÇøÊý
#define FAT_END_2M 0xFFF // Á´½Ó½áÊø
//----------------------------------------------------------------------------//
Statistics : Posted by cory.play • on Sun Feb 23, 2014 6:46 am • Replies 31 • Views 4644
Warning: I don't know what I'm doing, I don't know this software or hardware and have never even run the community addition. My C skills are so rusty the rust has rust. But, here is the first try. The enclosed .zip has the 3 files I changed and a .HEX file for app 3. If your brave, give it a try and lets see what works and what doesn't.
What I found: the only change that should matter is the sector size going from 512 to 4096. Files.c was hard coded to the old hardware and depends on sector size (unlike the normal C libraries). Based on comparing the new and old files I made adjustments in files.c and file.h and computed SectorSize and flash_mode the first time a file is opened (could call that from main, but I was looking for minimal dependencies to start with). So, this SHOULD still run with the old hardware.
I have never run the old version so it is a bit hard to know if it is running correctly.
This is running on the factory 1.6 "SYS". There are some changes to sys for the community version - I have not looked at those. Anyone who knows about all the dependencies may want to take a look. Perhaps the dependencies can be removed.
Other changes due to the 8M can be found in the file "FAT12c". I don't think they change anything in the application, but here they are just in case:
//-------FLASH-----W25Q64BV--------------------------------------------------//
#define FILE_BASE_8M 0x7000 // ÎļþÇø¿ªÊ¼µØÖ·
#define ROOT_BASE_8M 0x3000 // ¸ùĿ¼¿ªÊ¼µØÖ·
#define FAT_LEN_8M 0x1000
#define FAT1_BASE_8M 0x1000 // FAT1Çø¿ªÊ¼µØÖ·
#define FAT2_BASE_8M 0x2000 // FAT2Çø¿ªÊ¼µØÖ·
#define SEC_LEN_8M 0x1000 // ÉÈÇø³¤¶È
#define FAT1_SEC_8M 0x1 // FAT1ÉÈÇøÊý
#define FAT2_SEC_8M 0x1 // FAT2ÉÈÇøÊý
#define FAT_END_8M 0x7FF // Á´½Ó½áÊø
//----------------------------------------------------------------------------//
#define FILE_BASE_2M 0x8000 // ÎļþÇø¿ªÊ¼µØÖ·
#define ROOT_BASE_2M 0x4000 // ¸ùĿ¼¿ªÊ¼µØÖ·
#define FAT_LEN_2M 0x1800
#define FAT1_BASE_2M 0x1000 // FAT1Çø¿ªÊ¼µØÖ·
#define FAT2_BASE_2M 0x2800 // FAT2Çø¿ªÊ¼µØÖ·
#define SEC_LEN_2M 0x200 // ÉÈÇø³¤¶È
#define FAT1_SEC_2M 0x0C // FAT1ÉÈÇøÊý
#define FAT2_SEC_2M 0x0C // FAT2ÉÈÇøÊý
#define FAT_END_2M 0xFFF // Á´½Ó½áÊø
//----------------------------------------------------------------------------//
Statistics : Posted by cory.play • on Sun Feb 23, 2014 6:46 am • Replies 31 • Views 4644