Ethernut 5.2.2 - when using MCU_ATMEGA2561 and enabling "MMC Software SPI 0 Driver" the following error occurs:
In file included from ../../nut/dev/sbi0mmc0.c:116: ../../nut/dev/sbi_mmc.c: In function 'MMC_MISO_TEST': ../../nut/dev/sbi_mmc.c:93: error: cast to pointer from integer of different size In file included from ../../nut/dev/sbi0mmc0.c:116: ../../nut/dev/sbi_mmc.c: In function 'MMC_CS_IS': ../../nut/dev/sbi_mmc.c:108: error: cast to pointer from integer of different size
This was traced back to the GPIO library. Here is what I did to allow soft SD on AVR targets.
All changes are to the file /nut/include/cfg/arch/porttran.h:
line 456: #define GPIO_IS_HI(b) ((inr(GPIO_SOD_REG) & _BV(b)) == _BV(b)) becomes: #define GPIO_IS_HI(b) ((inb(GPIO_SOD_REG) & _BV(b)) == _BV(b)) line 462: #define GPIO_GET(b) ((inr(GPIO_PDS_REG) & _BV(b)) == _BV(b)) becomes: #define GPIO_GET(b) ((inb(GPIO_PDS_REG) & _BV(b)) == _BV(b))
Tested on Tickernut (mega2561 on 1.3g compatible homebrew hardware)
- All SD functions fully operational.
- Read and write speeds approaching 20K/s & 10K/s respectively