Upload fonts to external SPI Flash¶
The Commercial edition allows to use the external 8 Mbits = 1 MBytes x 8 SPI Flash memory, labelled U1
on the EXT3, EXT3.1 and EXT4 extension boards, to store fonts.
The standard reference of the SPI Flash memory is MX25V2006 .
The corresponding chip select pin is numbered 8 on the EXT3, EXT3.1 and EXT4 extension boards.
Variable | Number | Signal | Type | Function |
---|---|---|---|---|
.flashCS |
8 | Flash /CS | I |
Flash chip select |
Option 1: Segger J-Flash SPI¶
The Segger J-Link programmer-debugger offers a fast way to upload the fonts to the external SPI Flash of the EXT3. The List of supported SPI flash devices includes the MX25V2006.
Configure¶
Connect from the J-Link programmer-debugger to the extension board: the SPI signals CLK
, /CS
, DI
or MOSI
, DO
or MISO
; and power lines VTref
and GROUND
.
J-Link Channel |
J-Link Pin |
Extension board Pin |
Signal |
---|---|---|---|
VTref |
1 |
1 | VCC +3.3V from external supply |
CLK |
9 |
2 | SPI SCK |
DO or MISO |
13 |
6 | SPI MISO |
DI or MOSI |
5 |
7 | SPI MOSI |
nCS |
7 |
8 | Flash /CS |
GROUND |
4 , 6 , 8 ,10 or 12 |
10 | Ground |
To power the extension board, either provide an external 3.3V; or connect a 3.3V regulator to the J-Link programmer-debugger 5V-Supply
output and turn power on.
J-Link Channel |
J-Link Pin |
Extension board Pin |
Signal |
---|---|---|---|
5V-Supply |
19 |
- | VCC +5V supplied by J-Link |
For more information,
- Please refer to https://www.segger.com/products/debug-probes/j-link/tools/j-flash-spi/ .
Use¶
Two options: by command line or GUI.
Launch
$
JFlashSPI_CL -open Fonts_511.hex -auto
JFlashSPI_CL
loads the Fonts_511.hex
file, connects to the SPI Flash, uploads and verifies, then disconnects.
Launch the JFlashSPIExe
application.
Call the menu File > Open data file… and select the Fonts_511.hex
file; or drag-and-drop the Fonts_511.hex
file onto the application.
Call the menu Target > Connect to identify the external SPI Flash automatically and then the menu Target > Program to upload and flash the external SPI Flash automatically.
Call the menu File > Exit to quit the application.
More information is available at the page J-Flash SPI — Direct programming of (Q)SPI flashes on the Segger website.
Option 2: highView Fonts Manager¶
Configure¶
Ensure the targeted MCU provides enough memory in Flash to store the fonts.
Open the hV_Fonts_Manager.ino
project.
Set the options to write sector 0 and the fonts, and generate the header file with the fonts enumeration.
Optionally, set the options to read sector 0 and the fonts.
#define WRITE_FLASH_SECTOR_0 1 ///< Write or update sector 0
#define WRITE_FLASH_FONTS 1 ///< Write fonts to Flash
#define SIMULATE_FLASH_SECTOR_0 0 ///< Simulate sector 0
#define READ_FLASH_SECTOR_0 1 ///< Read sector 0
#define READ_FLASH_FONTS 1 ///< Read fonts from Flash
#define GENERATE_FONTS_ENUMERATION 1 ///< Generate code of header file with fonts enumeration
Use¶
Select the fonts to include under the setup()
function.
loadFont(Font_DejaVuMono12);
loadFont(Font_DejaVuMono12b);
Build and link, upload and run.
Copy the generated fonts enumeration into the hV_Font_Flash
header file for later use with the Fonts from external SPI Flash option.