-
Notifications
You must be signed in to change notification settings - Fork 202
Description
Hi All,
Firstly, awesome project and im almost there.
Using an ESP32 S3 dev board n16r8
ili9341 display
breadboard wiring/breakout board
have built custom firmware using the devkit c target
all flashed, launcher loading, but have the following issues that i just cant get to the bottom of, hope someone can help!
SD Card Mounting
[error] rg_storage_read_file: Fopen failed (22): '/sd/retro-go/config/global.json'
E (1738) diskio_sdmmc: Check status failed (0x107)
have tried multiple cards, capacitors, pull ups. I do get some mounting at launch, as it creates the basic system files and folders on a freshly formatted card.
So i tried to run it in internal flash mode to see if i can at least get all my hardware, buttons e.t.c confirmed as working. But same issue
[error] rg_storage_write_file: Fopen failed (22): '/storage/retro-go/config/global.json'
[error] rg_storage_read_file: Fopen failed (2): '/storage/retro-go/cache/crc32.bin'
I was able to successfully
flash a bin file to my storage partition
Wrote 5242880 bytes (19424 compressed) at 0x00900000 in 32.2 seconds (effective 1300.8 kbit/s)...
my partition table for reference:
ESP-IDF Partition Table
Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,20K,
otadata,data,ota,0xe000,8K,
phy_init,data,phy,0x10000,4K,
launcher,app,ota_0,0x20000,1792K,
retro-core,app,ota_1,0x1e0000,3M,
prboom-go,app,ota_2,0x4e0000,1152K,
gwenesis,app,ota_3,0x600000,2M,
fmsx,app,ota_4,0x800000,1M,
storage,data,spiffs,0x900000,5M,
Config.h file for refrence
// Target definition
#define RG_TARGET_NAME "ESP32S3-DEVKIT-C"
// Storage
#define RG_STORAGE_ROOT "/storage"
//#define RG_STORAGE_SDSPI_HOST SPI3_HOST
//#define RG_STORAGE_SDSPI_SPEED 1000
// #define RG_STORAGE_SDMMC_HOST SDMMC_HOST_SLOT_1
// #define RG_STORAGE_SDMMC_SPEED SDMMC_FREQ_DEFAULT
#define RG_STORAGE_FLASH_PARTITION "storage"
// Audio
#define RG_AUDIO_USE_INT_DAC 0 // 0 = Disable, 1 = GPIO25, 2 = GPIO26, 3 = Both
#define RG_AUDIO_USE_EXT_DAC 1 // 0 = Disable, 1 = Enable
// Video
#define RG_SCREEN_DRIVER 0 // 0 = ILI9341/ST7789
#define RG_SCREEN_HOST SPI2_HOST
#define RG_SCREEN_SPEED SPI_MASTER_FREQ_40M // SPI_MASTER_FREQ_80M
#define RG_SCREEN_BACKLIGHT 1
#define RG_SCREEN_WIDTH 320
#define RG_SCREEN_HEIGHT 240
#define RG_SCREEN_ROTATE 0
#define RG_SCREEN_VISIBLE_AREA {0, 0, 0, 0}
#define RG_SCREEN_SAFE_AREA {0, 0, 0, 0}
#define RG_SCREEN_INIT()
ILI9341_CMD(0xCF, 0x00, 0xc3, 0x30);
ILI9341_CMD(0xED, 0x64, 0x03, 0x12, 0x81);
ILI9341_CMD(0xE8, 0x85, 0x00, 0x78);
ILI9341_CMD(0xCB, 0x39, 0x2c, 0x00, 0x34, 0x02);
ILI9341_CMD(0xF7, 0x20);
ILI9341_CMD(0xEA, 0x00, 0x00);
ILI9341_CMD(0xC0, 0x1B); /* Power control //VRH[5:0] /
ILI9341_CMD(0xC1, 0x12); / Power control //SAP[2:0];BT[3:0] /
ILI9341_CMD(0xC5, 0x32, 0x3C); / VCM control /
ILI9341_CMD(0xC7, 0x91); / VCM control2 /
ILI9341_CMD(0x36, 0x68); / Memory Access Control (MX|MV|BGR) /
ILI9341_CMD(0xB1, 0x00, 0x10); / Frame Rate Control (1B=70, 1F=61, 10=119) /
ILI9341_CMD(0xB6, 0x0A, 0xA2); / Display Function Control /
ILI9341_CMD(0xF6, 0x01, 0x30);
ILI9341_CMD(0xF2, 0x00); / 3Gamma Function Disable /
ILI9341_CMD(0x26, 0x01); / Gamma curve selected */
ILI9341_CMD(0xE0, 0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, 0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00);
ILI9341_CMD(0xE1, 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F);
// Refer to rg_input.h to see all available RG_KEY_* and RG_GAMEPAD__MAP types
#define RG_GAMEPAD_ADC_MAP {
/ ADC Joystick not used /
}
#define RG_GAMEPAD_GPIO_MAP {
/ D-Pad /
{RG_KEY_LEFT, .num = GPIO_NUM_4, .pullup = 1, .level = 0},
{RG_KEY_RIGHT, .num = GPIO_NUM_5, .pullup = 1, .level = 0},
/ Action Buttons /
{RG_KEY_A, .num = GPIO_NUM_6, .pullup = 1, .level = 0},
{RG_KEY_B, .num = GPIO_NUM_7, .pullup = 1, .level = 0},
{RG_KEY_X, .num = GPIO_NUM_8, .pullup = 1, .level = 0},
{RG_KEY_Y, .num = GPIO_NUM_19, .pullup = 1, .level = 0},
/ System Buttons (Commented out) /
/ {RG_KEY_START, .num = GPIO_NUM_20, .pullup = 1, .level = 0}, /
/ {RG_KEY_SELECT, .num = GPIO_NUM_26, .pullup = 1, .level = 0}, /
/ {RG_KEY_MENU, .num = GPIO_NUM_31, .pullup = 1, .level = 0}, /
/ {RG_KEY_OPTION, .num = GPIO_NUM_32, .pullup = 1, .level = 0}, */
}
// Battery
//efine RG_BATTERY_DRIVER 1
//efine RG_BATTERY_ADC_UNIT ADC_UNIT_1
//efine RG_BATTERY_ADC_CHANNEL ADC_CHANNEL_3
//efine RG_BATTERY_CALC_PERCENT(raw) (((raw) * 2.f - 3500.f) / (4200.f - 3500.f) * 100.f)
//efine RG_BATTERY_CALC_VOLTAGE(raw) ((raw) * 2.f * 0.001f)
// Status LED
#define RG_GPIO_LED GPIO_NUM_38
// SPI Display (back up working)
#define RG_GPIO_LCD_MISO GPIO_NUM_NC
#define RG_GPIO_LCD_MOSI GPIO_NUM_11
#define RG_GPIO_LCD_CLK GPIO_NUM_12
#define RG_GPIO_LCD_CS -1
#define RG_GPIO_LCD_DC GPIO_NUM_47
#define RG_GPIO_LCD_BCKL GPIO_NUM_40
#define RG_GPIO_LCD_RST GPIO_NUM_39
//#define RG_GPIO_SDSPI_MISO GPIO_NUM_14
//#define RG_GPIO_SDSPI_MOSI GPIO_NUM_15
//#define RG_GPIO_SDSPI_CLK GPIO_NUM_16
//#define RG_GPIO_SDSPI_CS GPIO_NUM_10
// External I2S DAC
#define RG_GPIO_SND_I2S_BCK 41
#define RG_GPIO_SND_I2S_WS 42
#define RG_GPIO_SND_I2S_DATA 20
// #define RG_GPIO_SND_AMP_ENABLE 18