gnuk/doc/development.rst

63 lines
1.6 KiB
ReStructuredText
Raw Normal View History

2012-07-21 00:26:51 +00:00
Development Environment
=======================
Hardware
--------
2012-12-26 02:11:18 +00:00
For development, it is highly recommended to have JTAG/SWD debugger.
2012-08-02 08:11:42 +00:00
2012-12-26 02:11:18 +00:00
For boards with DFU (Device Firmware Upgrade) feature (such as DfuSe),
2012-08-02 08:11:42 +00:00
it is possible to develop with that. But it should be considered
*experimental* environment, and it should not be used for usual
purpose. That's because it is basically impossible for DfuSe
implementations to disable reading-out from flash ROM. It means
2013-10-24 07:02:50 +00:00
that your secrets will be readily extracted by DfuSe.
2012-08-02 08:11:42 +00:00
For JTAG debugger, Olimex JTAG-Tiny is good and supported well. For
SWD debugger, ST-Link/V2 would be good, and it is supported by
2012-12-26 02:11:18 +00:00
tool/stlinkv2.py.
2012-08-02 08:11:42 +00:00
OpenOCD
-------
2016-06-21 05:44:51 +00:00
For JTAG/SWD debugger, we can use OpenOCD.
2012-07-21 00:26:51 +00:00
GNU Toolchain
-------------
You need GNU toolchain and newlib for 'arm-none-eabi' target.
2016-06-21 05:44:51 +00:00
In Debian, we can just apt-get packages of: gcc-arm-none-eabi, binutils-arm-none-eabi, gdb-arm-none-eabi and libnewlib-arm-none-eabi.
2012-07-21 00:26:51 +00:00
2016-06-21 05:44:51 +00:00
We are using "-O3 -Os" for compiler option.
2012-07-21 00:26:51 +00:00
Building Gnuk
-------------
2018-01-23 00:31:03 +00:00
Change directory to ``src``: ::
2012-07-21 00:26:51 +00:00
$ cd gnuk-VERSION/src
2018-01-23 00:31:03 +00:00
Then, run ``configure``: ::
2012-07-21 00:26:51 +00:00
$ ./configure --vidpid=<VID:PID>
Here, you need to specify USB vendor ID and product ID. For FSIJ's,
2012-12-26 02:11:18 +00:00
it's: --vidpid=234b:0000 . Please read the section 'USB vendor ID and
product ID' in README.
2012-07-21 00:26:51 +00:00
2018-01-23 00:31:03 +00:00
Type: ::
2012-07-21 00:26:51 +00:00
$ make
2013-10-24 07:02:50 +00:00
Then, we will have "gnuk.elf" under src/build directory.
2018-01-23 00:31:03 +00:00
2018-05-10 04:48:17 +00:00
If you are not the authorized vendor, please never distribute this
file of "gnuk.elf", which includes VID:PID in the image. If you would
like to distribute the image (for example, to check if it's
reproducible or not), the file "gnuk-no-vidpid.elf" is the one with no
VID:PID.