This document demonstrates how FileFerry-click2Flash can be used for your project!
- Release_Contents_overview
- Setup
- Usage_Instructions
- DiagnosticsInformation
- Build-Instruction
- Documentation
- Contact-Me
The prebuilt binaries released are available under the release folder @ref /Firmware/Releases is comprised of
- APP: Application Binaries
- BUILD_DEBUG: Debug Build with all debug symbols and messages enabled for debugging purposes
- BUILD_PROD: Production build optimized for performance. Meant for use on the production floor
- FasalFlasher_ReleaseNote.pdf: Release Note with details about the build and usage
- ReadMe.txt: Instructional text document that captures essential Release information
The following steps are to be followed with a new FileFerry-Click2Flash device
- ST Cube Programmer : To upload binaries to device
- TeraTerm : Or equivalent serial monitor tool with XModem protocol
- The external device (Target) needs to be empty prior to usage with Fasal Flasher. If a program is running on it, it will interfere with the flashing operation.
- You can put the device in "suspend" mode. (Example: Use BOOT0 if the target has a STM32 MCU to halt program execution).
- Alternately, erase the MCU's (or MPU's) internal Flash program.
- The precompiled binary of the FileFerry-Click2Flash expects a file name "Fallback.txt" in the SD Card to be present. This "Fallback.txt" gets transferred to the Target SPI Flash.
- Note: ".txt" is just a file format notation and not an actual text file. The file in the demo is a ".srec" compiled binary that can be used to perform DFU of a target STM32 MCU. The .srec compiled binary is renamed as "Fallback.txt".
- Copy the file "Fallback.txt" into an SD-card and insert the same into the FileFerry-Click2Flash device. Please note that that any file that needs to be transferred must be named Fallback.txt for the file to be recognized by the FileFerry-Click2Flash.
- You may change the file name expected by the FileFerry-Click2Flash, recompile the code and upload the new code to the FileFerry-Click2Flash device. You can then rename the SD card file accordingly.
- Insert the above SD card (with the "fallback.txt" file in it).
- Connect a Type-C USB and slide the power switch to power on the device.
- Connect a STLink V3 minie on the programming header.
- Open the STM32cube Programmer.
- First, erase the complete device using Full chip erase option under Erasing and programming section in the side-Menu
- Select & load application file App/PROD/FasalFlasher_Vx_y_PROD.srec to device
- Ensure that the device is powered over USB and the power switch is ON, and that the set up is complete as instructed in the application setup
- The operation mode can be selected as either SD-Card mode or XModem mode though the slide switch. The two modes are described below
- Ensure that the device whose Flash needs to be programmed is not running any application. Disconnect the power source for the external board and connect to the flash SPI interface using the Pogo interface
- The application state will be indicated in accordance with []
- A correctly set up device will wait for the User Flash button button
- Once the Button is pressed the device will initialize both the onboard SD-Card interface and the external flash.
- The files will be copied, integrity will be checked and the status will be indicated
- The file transfer status will be indicated over LED and the console
- A correctly set up device will wait for the User Flash button button
- Once the Button is pressed the device will wait for the golden image file over the serial interface
- Launch Serial USB terminal, select the appropriate com-port and use the following Serial settings
- Baud Rate : 115200
- Data : 8 bit
- Speed : 115200
- Stop bits : 1 bit
- Flow control : none
- The file transfer status will be indicated over LED and the console
- XModem mode can be used either over PC though serial terminal programs like TeraTerm or cell phone over USB serial terminal.
The application status is indicated by the On board TriColor LED during program execution. The application states, their meaning and corresponding indication state is documented below
App State | Indication |
---|---|
eFASAL_APP_INIT | eIND_BLUE_250MS |
eFASAL_APP_BUTTON_WAIT | eIND_BLUE_500MS |
eFASAL_APP_SD_INIT | eIND_BLUE_1000MS |
eFASAL_APP_SD_CHECK | eIND_BLUE_1000MS |
eFASAL_APP_FLASH_INIT | eIND_BLUE_1000MS |
eFASAL_APP_MODE_SELECTION | eIND_BLUE_1000MS |
eFASAL_APP_SD_FLASH_TRANSFER | eIND_YELLOW_1000MS |
eFASAL_APP_XMODEM_TRANSFER | eIND_YELLOW_1000MS |
eFASAL_APP_CRC_COMPARE | eIND_YELLOW_1000MS |
eFASAL_APP_TRANSFER_SUCCESS | eIND_GREEN_0 |
eFASAL_APP_SD_FAIL | eIND_RED_250MS |
eFASAL_APP_SD_FILE_FAIL | eIND_RED_250MS |
eFASAL_APP_TRANSFER_FAIL | eIND_RED_250MS |
eFASAL_APP_CRC_FAIL | eIND_RED_250MS |
eERR_ARM_FAULT | eIND_RED_250MS |
eFASAL_APP_END | eIND_RED_250MS |
eFASAL_MAX_STATE | eIND_RED_250MS |
The application also supporters error codes to indicate specific error conditions. These are captured below along with the indication if present
Error Code | Error |
---|---|
0x0000 | eERR_NO_ERRORS |
0x0001 | eERR_SDCARD_NOT_FOUND |
0x0002 | eERR_SDCARD_FILE_NOT_FOUND |
0x0004 | eERR_FLASH_NOT_FOUND |
0x0008 | eERR_FLASH_TRANSFER_FAILURE |
0x0010 | eERR_CRC_FAILURE |
0x1000 | eERR_STM_HAL_FAILURE |
0x2000 | eERR_ARM_FAULT |
0x4000 | eERR_ASSERTION_FAILURE |
0x8000 | eERR_SLEEP_FAILURE |
If you want to modify the firmware functionality, you can re-build the code for the FileFerry-Click2Flash device using these steps:
- Built using CubeIDE Version: 1.15.1 Build: 21094_20240412_1041 (UTC)
- Both BUILD_DEBUG and BUILD_PROD Uses Linker script STM32f103RETX_FLASH.ld with flash offset of 0x0800 0000, application size set to 512KB
- The following build configurations are built into the codebase
-
BUILD_DEBUG : Debug build used during development with all debug symbols enabled
- Optimization level : None
- Symbols defined : DEBUG | STM32F103xE | USE_HAL_DRIVER
-
BUILD_PROD : Production build for filed use
- Optimization level : Ofast
- Symbols defined : NDEBUG | STM32F103xE | USE_HAL_DRIVER
-
- @ref SourceCode/FasalFlasher/User_Files/AppCommon/AppConfiguration for changing compile time build features
- Doxygen files are generated under @ref Docs/html by running the following command in the current folder
doxygen Doxyfile
- The files can be viewed by opening Index.html in any browser. Files located here @ref Docs/html
- Latex Generated PDF file is preset at @ref Docs/Design_Document/FasalFlasher_FirmwareDesignDocument.pdf
- [email protected] over E-Mail
- Vishal Keshava Murthy over LinkedIn