2016-11-07 21:34:08 +01:00
|
|
|
include ../Makefile.tests_common
|
|
|
|
|
|
|
|
BOARD ?= native
|
|
|
|
|
2017-10-18 23:59:37 +02:00
|
|
|
FEATURES_OPTIONAL += periph_rtc
|
2022-01-06 10:22:12 +01:00
|
|
|
FEATURES_REQUIRED += periph_spi
|
2017-07-05 14:54:42 +02:00
|
|
|
|
|
|
|
USEMODULE += shell
|
|
|
|
USEMODULE += fatfs_diskio_mtd
|
|
|
|
USEMODULE += mtd
|
|
|
|
USEPKG += fatfs
|
|
|
|
|
|
|
|
FATFS_IMAGE_FILE_SIZE_MIB ?= 128
|
2016-11-07 21:34:08 +01:00
|
|
|
|
|
|
|
ifeq ($(BOARD),native)
|
2017-07-05 14:54:42 +02:00
|
|
|
#overwrite default mtd_native-config to use fat image as flash device
|
|
|
|
CFLAGS += -DMTD_NATIVE_FILENAME=\"./bin/riot_fatfs_disk.img\"
|
|
|
|
CFLAGS += -DFATFS_IMAGE_FILE_SIZE_MIB=$(FATFS_IMAGE_FILE_SIZE_MIB)
|
2018-02-22 08:27:24 +01:00
|
|
|
CFLAGS += -DMTD_SECTOR_NUM=\(\(\(FATFS_IMAGE_FILE_SIZE_MIB\)*1024*1024\)/MTD_SECTOR_SIZE\)
|
2016-11-07 21:34:08 +01:00
|
|
|
else
|
2017-07-05 14:54:42 +02:00
|
|
|
# for actual hardware use mtd_sdcard as storage device
|
|
|
|
USEMODULE += mtd_sdcard
|
2016-11-07 21:34:08 +01:00
|
|
|
endif
|
|
|
|
|
2017-07-05 14:54:42 +02:00
|
|
|
image:
|
2021-09-02 17:17:42 +02:00
|
|
|
${Q}mkdir -p bin
|
2021-09-02 17:16:52 +02:00
|
|
|
${Q}tar -xjf riot_fatfs_disk.tar.bz2 -C ./bin/
|
2017-07-05 14:54:42 +02:00
|
|
|
|
|
|
|
#this generates a compressed fat image file that can be used by the fat driver on native
|
|
|
|
compressed-image:
|
2021-09-02 17:16:52 +02:00
|
|
|
${Q}./create_fat_image_file.sh $(FATFS_IMAGE_FILE_SIZE_MIB)
|
2016-11-07 21:34:08 +01:00
|
|
|
|
|
|
|
include $(RIOTBASE)/Makefile.include
|