filesystem not mounted on custom hw using stm32f405vg
Posted: Thu Jan 31, 2019 2:37 pm
Hello Everyone!!
I have done a custom bootloader for my custom hw using the stm32 series stm32f405vgt6.
The bootloader resides at 0x08000000 (32K space has been allocated out of which 25K is the bootloader)
Firmware0.bin resides at 0x08008000 (16K space has been allocated)
Filesystem resides at 0x0800C000 (208K space has been allocated)
Firmware1.bin resides at 0x08040000 (768K space has been allocated)
This is the memory map which I have in stm32f405.ld and my mpconfigboard.mk looks like the following
MCU_SERIES = f4
CMSIS_MCU = STM32F405xx
AF_FILE = boards/stm32f405_af.csv
LD_FILES = boards/stm32f405.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08008000
TEXT1_ADDR = 0x08040000
I have been trying to put up main.py as a frozen module using "pyexec_frozen_module(main_py)"
// At this point everything is fully configured and initialised.
// Run the main script from the current directory.
if ((reset_mode == 1 || reset_mode == 3) && pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) {
const char *main_py;
if (MP_STATE_PORT(pyb_config_main) == MP_OBJ_NULL) {
main_py = "main.py";
} else {
main_py = mp_obj_str_get_str(MP_STATE_PORT(pyb_config_main));
}
mp_import_stat_t stat = mp_import_stat(main_py);
if (stat == MP_IMPORT_STAT_FILE) {
int ret = pyexec_frozen_module(main_py);
if (ret & PYEXEC_FORCED_EXIT) {
goto soft_reset_exit;
}
if (!ret) {
flash_error(3);
}
}
}
Above is the code snippet that I have in main.c . But this part of code is not at all executed.
This works as expected without custom bootloader. i.e(firmware0.bin @0x08000000 and firmware1.bin @ 0x08020000)
Any help is greatly appreciated!!
Thanks in advance
I have done a custom bootloader for my custom hw using the stm32 series stm32f405vgt6.
The bootloader resides at 0x08000000 (32K space has been allocated out of which 25K is the bootloader)
Firmware0.bin resides at 0x08008000 (16K space has been allocated)
Filesystem resides at 0x0800C000 (208K space has been allocated)
Firmware1.bin resides at 0x08040000 (768K space has been allocated)
This is the memory map which I have in stm32f405.ld and my mpconfigboard.mk looks like the following
MCU_SERIES = f4
CMSIS_MCU = STM32F405xx
AF_FILE = boards/stm32f405_af.csv
LD_FILES = boards/stm32f405.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08008000
TEXT1_ADDR = 0x08040000
I have been trying to put up main.py as a frozen module using "pyexec_frozen_module(main_py)"
// At this point everything is fully configured and initialised.
// Run the main script from the current directory.
if ((reset_mode == 1 || reset_mode == 3) && pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) {
const char *main_py;
if (MP_STATE_PORT(pyb_config_main) == MP_OBJ_NULL) {
main_py = "main.py";
} else {
main_py = mp_obj_str_get_str(MP_STATE_PORT(pyb_config_main));
}
mp_import_stat_t stat = mp_import_stat(main_py);
if (stat == MP_IMPORT_STAT_FILE) {
int ret = pyexec_frozen_module(main_py);
if (ret & PYEXEC_FORCED_EXIT) {
goto soft_reset_exit;
}
if (!ret) {
flash_error(3);
}
}
}
Above is the code snippet that I have in main.c . But this part of code is not at all executed.
This works as expected without custom bootloader. i.e(firmware0.bin @0x08000000 and firmware1.bin @ 0x08020000)
Any help is greatly appreciated!!
Thanks in advance