Commit Graph

44 Commits (master)

Author SHA1 Message Date
Eric Wild 3761545fcf usb serial number descriptor
Change-Id: I4a23682cee0849c788e5f6c611df4ed1f1cac3da
2021-06-30 08:16:43 +00:00
Harald Welte b932c514f3 contrib/ Switch from rita ->
We should use service-aliases and not the primary host name, as
that makes migration between machines hard.

Change-Id: I1ba0a5e6185af1fba5e7cccb7966fda2fa50bf24
2021-04-22 11:21:56 +02:00
Harald Welte b90f7068da update iManufacturer strings (full sysmocom company name, ...)
this ensures the iManufacturer string is identical across different

Change-Id: I45ce8b6d182d6e2d9f1fefa4928f85860b68d2fb
2019-12-06 22:34:13 +01:00
Harald Welte dc5bdcf7db Introduce 'make clean' between different board builds
Change-Id: I907c9d7ec805ee7f1d7383a23941d338bcd89dfd
2019-11-30 22:00:57 +01:00
Harald Welte 53feef0f69 contrib/ move to /bin/bash
We need this in order to support constructs like foobar.{bin,elf} to
expand properly.

Change-Id: I3d12795da7ab29d1bd0f7371c3365c54c79ae09a
2019-11-30 22:00:57 +01:00
Harald Welte ed363a4a0e Add --publish to publish binaries, similar to simtrace2.git
Binaries will be on

Change-Id: Idc27a3d7d2bd7cbee1061ce778ace280eff17bf4
2019-11-30 16:18:22 +01:00
Harald Welte aec6b1ee85 create bootloader-$(BOARD).{elf,bin} symlinks
Change-Id: I3a1eb038e51f4b38ae2e2154bd53c615d98db517
2019-11-11 19:18:40 +01:00
Harald Welte 397966fa3c include board (target) in filename, files are now called like

Change-Id: Ibdde1c02d5dd3bcd714bae1d374397d9596fede0
2019-11-11 19:14:51 +01:00
Harald Welte 5554133528 name binaries including their git version number
Change-Id: I90fb8e6effd05c3e472492aced7c07a2ce837e5e
Related: OS#3452
2019-06-20 18:39:55 +02:00
Kevin Redon 5538ea8530 minox: use RAM address define instead of hardcoded value
Change-Id: I81a42637194cbf0b5152fe38c691522021ab7582
2019-02-15 10:10:38 +01:00
Kevin Redon 6794b97e21 fix DFU magic address and linker script
using the address specified in the linker script leads to a large
output binary (as large as the address specified.
instead the address is now specified in the source file.

Change-Id: I69ad101593e903b74084f179cfc97fccccdfa5a3
2019-02-15 10:08:39 +01:00
Kevin Redon b842918d16 set initial DFU state to ERROR if application is corrupt
as specified in DFU standard

Change-Id: Icd503a2d19f829eb43a83c28b526b73d595640f0
2019-02-14 18:59:39 +01:00
Kevin Redon 45554d71f9 add force DFU using magic value
if the string "DFU!" is found at the beginning of the RAM (e.g. as
written by the main application during USB detach), the DFU
bootloader will be started.

Change-Id: I298e3697c06d352a6e0f47266097844c490e1722
2019-02-14 18:45:20 +01:00
Kevin Redon 9336494491 minor: rename output binary to bootloader
Change-Id: I4dfa761c482d6d061eddf3ff8ee91ec049955f53
2019-02-14 18:45:17 +01:00
Kevin Redon 5fcc4ac54a add specific board support, including sysmoOCTSIM
the board specific definitions should be coded when particular
environment variable/marco is defined.
this macro name is provided by the makefile in the BOARD variable.
this allows to compile the bootloader for specific devices.
see README for more information.
the board definition for the sysmoOCTSIM is also added.

Change-Id: Ie51a3af7c77ba76ac40570b871f31fd527fb255b
2019-02-14 17:21:14 +01:00
Benjamin Freeman f278032e9f fix USB transfer
this ASFv4 USB library change fixes USB transfer.
two transfer-size issues existed:
- on multi-packet transfer if the last packet was less than the
USB transfer packet size, the packet would be received but not
- during normal transfer the packet size of a previous packet set
the size of the current packet, ignoring the actual transfer size

transfer with a combination of partial or full USB single packet,
USB multi-packet, max transfer, and control endpoint sizes was
successfully tested (in bytes): 4, 32, 64, 128, 129, 512, 516,
544, 576, 640, 641, 1024, 1028

Change-Id: Ic4e64168e865362e12e0b76386f964895b8b6c20
2019-02-14 12:48:56 +01:00
Kevin Redon 26037ab23b remove OCTSIM in USB ID
this bootloader is initiated and meant for the sysmo-OCTSIM, but
it can be applied for other SAM E5x/D5x boards.
Thus we remove the OCTSIM name an just use the more generic
bootloader name.

Change-Id: Icc46f0d8b4b649fd00b5c6cea5bad91a93891f14
2019-01-31 18:02:10 +01:00
Kevin Redon 9bd6f6f474 reduce number of endpoints
only endpoint 0 is used, thus there is no need to define more.
this also saves RAM.

Change-Id: I52a5d2d3c3d09ca7dfa165535ccc295bf190841b
2019-01-16 18:41:23 +01:00
Kevin Redon e49a3dbeba add button to force DFU bootloader
Change-Id: I163ab2de0fcbe13532c1992f6b78d49f4cda2d88
2019-01-16 18:41:23 +01:00
Kevin Redon 388dac3f87 start application if valid at boot
if the application is not valid, check and start the bootloader

Change-Id: I323f2b3a1828d3e40a02c7fc755d07009fb43a85
2019-01-16 18:41:23 +01:00
Kevin Redon b0a7dde6a6 add README file
this describes the project, how to compile, and how to flash the
USB DFU bootloader

Change-Id: If884bca373aab10fe74d16f42b79dd6685eeabcf
2019-01-16 18:41:23 +01:00
Kevin Redon dfa652604c use reserved bootloader get application start
the reserved bootloader size is set in the NVM user configuration
and allows to know the application start address (e.g. after the

Change-Id: I9dda27d6401caabb4a6470aa3fe9691f63097136
2019-01-16 18:41:23 +01:00
Kevin Redon 37409534d7 enable flashing by providing real downloaded data length
Change-Id: I6f16170a4b41a70d89954e2c4a841efc67a26786
2019-01-16 18:41:23 +01:00
Kevin Redon 389aca7c2e set USB string to osmocom osmo-ASF4-DFU
Change-Id: I001a7b6f54b3aaab04d55e84cd9ada0daa423805
2019-01-16 18:41:23 +01:00
Kevin Redon 0d59ac02cb add license file
this include the LGPL v2.1 for the DFU stack, ASF for the ASFv4
library, and Apache 2.0 for the CMSIS.

Change-Id: If7b127ddd23bd8c5d158a731d58d425cdf6330f4
2019-01-16 18:41:23 +01:00
Kevin Redon 78aca8fdbc remove unused example code
Change-Id: I205cd02f0c9a55d22bb78e84a88a29afe31224b0
2019-01-16 18:41:23 +01:00
Kevin Redon e9e0d46432 remove unused ARMCC Makefile
Change-Id: I232502798d71c97d0e7b4adf6bb6af3fa0940bd1
2019-01-16 18:41:23 +01:00
Kevin Redon b140e502aa removed unused USB CDC stack
Change-Id: Ib1735ad4add9278be9a1fb730752377de99c4f4b
2019-01-16 18:41:23 +01:00
Kevin Redon 5ba20ae63b implement flashing-side of the DFU state machine
the USB-side state machine currently sets the length to 0,
preventing the actual flashing to be tested

Change-Id: I5ed9cc2a22ed5e41bb59a3ce3f21ab098cec48e7
2019-01-16 18:41:23 +01:00
Kevin Redon dd3269b421 restructure and complete the USB-side DFU state machine
the USB control request are now handled in separate function
depending on the direction (IN or OUT).
download and manifestation are handled.
numerous additional state machine fixes are included.

Change-Id: I5237393c2789fdeddca2182da25ef417a2e71216
2019-01-16 18:41:23 +01:00
Kevin Redon 9e94e7d7ca make USB descriptor available for the two state machines
this is required to know the DFU bmAttributes since they affect
the state machine

Change-Id: Ib3907423bb9e197f53ed4522e8a5789a3d29489e
2019-01-16 18:41:23 +01:00
Kevin Redon 2f8fcbbef6 declare variables so the main loop can read the data to be flashed provided by the USB stack
Change-Id: I092357aad95abef1a781be1ea77944f2ea523dab
2019-01-16 18:41:23 +01:00
Kevin Redon d25509abca add system LED initialisation
Change-Id: I79f1b769fc9dd7e1a972bacf0928ff46988f0e36
2019-01-16 18:40:31 +01:00
Kevin Redon 5c7d9805c2 add code to initialize flash
Change-Id: I2a208abb39a9da8796e2a4bcb803ce32686cb95f
2019-01-16 18:40:31 +01:00
Kevin Redon 9bebe583ae add flash ASF4 driver
this is imported from the Atmel Start website

Change-Id: I5eccb37da64c7def7b99418773d09b6d98664432
2019-01-16 18:40:31 +01:00
Kevin Redon 2257c6c32a add initial DFU class request handling
downloading is not supported yet, but the rest works

Change-Id: I4896d73602bb1b1001c1ce3af9b98e5173b45edf
2019-01-16 18:40:31 +01:00
Kevin Redon c976a85af4 add documentation and fix timeout value
Change-Id: Ia1d6ef4e4a5c9929aefd149c4e3eaf2dfe37fea8
2019-01-16 18:40:31 +01:00
Kevin Redon 74a8e3b615 fix USB enabling
Change-Id: I22cdd77648ac21490909423bf529fb31f30d6af0
2019-01-16 18:40:31 +01:00
Kevin Redon 56739ea049 ignore gdb history file
Change-Id: Ie3acf07ad7404fa3981baf65dab2a3ef416f9938
2019-01-16 18:40:31 +01:00
Kevin Redon efd55db9cc add USB DFU description
uses the USB CDC ACM example code as template to create a USB DFU
description according to USB DFU specification version 1.1

USB DFU stack is under LGPLv2.1 or later license

Change-Id: I7bd6cb46b734ffe8a51f2de7083b4f9e76d385e6
2019-01-16 18:39:41 +01:00
Kevin Redon df28f25276 ignore output files
Change-Id: Ia6c90711a67a9b1cafc7a6cc3b07aa769e8684d0
2019-01-16 18:29:20 +01:00
Max 77643ea6c3 Add git-review config
Change-Id: If28c2f4908f8df96b627fd42b7e122e559d9382a
2019-01-13 13:05:24 +00:00
Harald Welte 9079bc8bcd add contrib/ for build verification
Change-Id: I7ba3a711c3291ca3d61c8064e3e94ab2ae7563e3
2019-01-13 13:40:56 +01:00
Kevin Redon 8476b94ab0 use USB CDC Echo example project
this is the USB CDC Echo example project source code,
for the Microchip SAM E54 Xplained Pro development board,
based on the ATSAME54P20A micro-controller,
exported from the Atmel START website,
using the ASFv4 library.

Change-Id: Ic0e58e42d1a4076bc84a0a8d3509ec4b09a37f46
2019-01-09 15:33:36 +01:00