Gap targets
Default layout
All Gap targets are instantiating flashes which are derived from the same flash
description described in gapylib.chips.gap.flash.DefaultFlashRomV2
.
This flash description first defines all the allowed sections, and then provides the default layout.
The default layout contains first a ROM section, in case the flash is used for booting, a partition table, all kind of file-systems and a final raw partition to take the rest of the empty space in the flash.
The JSON file defining this default layout is the following:
{
"sections": [
{
"name": "rom",
"template": "rom",
"properties": {
"binary": null,
"boot": false
}
},
{
"name": "partition table",
"template": "partition table"
},
{
"name": "readfs",
"template": "readfs",
"properties": {
"files": []
}
},
{
"name": "hostfs",
"template": "hostfs",
"properties": {
"files": []
}
},
{
"name": "lfs",
"template": "lfs",
"properties": {
"size": 0,
"root_dir": null
}
},
{
"name": "raw",
"template": "raw",
"properties": {
"size": -1
}
}
]
}
Board platform
OpenOCD configuration
When using Gap boards, the target is managed through OpenOCD, which requires a few specific options to be set to properly configure OpenOCD.
By default, Gapy will call the executable openocd, which should be accessible from the environment variable PATH. If it is not the case, the path to the executable can be specified through the option –openocd=<openocd path>.
The OpenOCD cable must be specified through option –openocd-cable=<cable path>. This option is mandatory and has no default value. It can for example be set to $(GAP_SDK_HOME)/utils/openocd_tools/tcl/gapuino_ftdi.cfg.
The OpenOCD script for managing the target must be specified through option –openocd-script=<script path>. This option is mandatory and has no default value. It can for example be set to $(GAP_SDK_HOME)/utils/openocd_tools/tcl/gap9revb.tcl.
The path to the OpenOCD GAP tools must be specified through option –openocd-tools=<tools path>. This option is mandatory and has no default value. It can for example be set to $(GAP_SDK_HOME)/utils/openocd_tools.
GDB
GDB is by default disabled and can be enabled by adding option –gdb. The port for the connection between GDB and OpenOCD can be specified through option –gdb-port=<port>.
Flash content upload
By default, to avoid unnecessary flash upload, Gapy will try to determine if the content should be uploaded. The decision is based on the flash automatic mode, which determines if the flash is considered empty or not. More information is given in Flash management.
If the flash content is uploaded, Gapy will try to limit the size of the upload by removing the last empty sections.