Thu, 07 Oct 2021 22:24:45 +0200
Possibly fix the 'reset FP while running' case
59 | 1 | # Replacement front panel for the HP/Agilent 34970A - firmware |
2 | ||
3 | This repository contains the firmware for the replacement front panel for the | |
4 | HP 34970A acuisition unit described | |
5 | [here](https://whatever.sdfa3.org/hp-34970a-data-acquisition-unit-part-5.html) | |
6 | ||
7 | It is based on the [Mbed-os](https://os.mbed.com) framework and uses the | |
8 | [platformio](https://platformio.org/) development environment. | |
9 | ||
10 | Make sure to have this later properly installed (I suggest you install it in a | |
11 | Python 3 virtualenv). | |
12 | ||
13 | The firmware has been developped using platformio version 5.0.3 and Mbed-os 6.2. | |
14 | ||
15 | ## Compilation | |
16 | ||
17 | It should be a simple matter of calling: | |
18 | ||
19 | ``` | |
20 | (pio3) ~/p/p/hp34970disp$ pio run -e fp_dfu | |
21 | [...] | |
22 | Advanced Memory Usage is available via "PlatformIO Home > Project Inspect" | |
23 | RAM: [== ] 21.4% (used 14048 bytes from 65536 bytes) | |
24 | Flash: [== ] 22.9% (used 90040 bytes from 393216 bytes) | |
25 | ========================================== [SUCCESS] Took 28.13 seconds ========================================== | |
26 | ||
27 | Environment Status Duration | |
28 | ------------- -------- ------------ | |
29 | fp_dfu SUCCESS 00:00:28.129 | |
30 | ========================================== 1 succeeded in 00:00:28.129 ========================================== | |
31 | ||
32 | ``` | |
33 | ||
34 | Note: the `platformio.ini` provides 2 similar environments (`fp_dfu` and | |
35 | `fp_stlink`) which are identical but the `upload_protocol`. | |
36 | ||
37 | ## Uploading the firmware | |
38 | ||
39 | You can upload the firmware either via the (USB) DFU mode or the SWD/STLink | |
40 | port on the PCB. Note that the USB socket on the PCB does not power the board, | |
41 | so it must be already powered (which is typically when the board is connected | |
42 | to the main CPU board of the HP 34970A). | |
43 | ||
44 | In order to be able to upload the firware by DFU, the STM32 MCU on the front | |
45 | panel must be booted in DFU mode, which can be done by pressing the DFU button, | |
46 | then the RESET button while keeping the DFU pressed. | |
47 | ||
48 | The STLink upload method does not need the board o be booted in DFU mode. | |
49 | ||
50 | ``` | |
51 | (pio3) ~/p/p/hp34970disp$ pio run -e fp_dfu -t upload | |
52 | ``` | |
53 | ||
54 | or | |
55 | ||
56 | ``` | |
57 | (pio3) ~/p/p/hp34970disp$ pio run -e fp_stlink -t upload | |
58 | ``` | |
59 | ||
60 | ## Credits | |
61 | ||
62 | THis firmware uses a modified version of the [UniGraphic]() library and the | |
63 | [QEI]() library. | |
64 | ||
65 | ||
66 | ## Notes (deprecated) | |
67 | ||
68 | Use mbed 6 | |
26 | 69 | |
70 | For some reason I had to disable mbed-client-cli/ (multiple definition of `cmd' error at | |
71 | link time). | |
72 | Put a .mbedignore file in: | |
73 | ||
74 | $ cd /home/david/.platformio/packages/framework-mbed@6.51504.200716/features | |
75 | $ cat .mbedignore | |
76 | mbed-client-cli/* | |
77 | frameworks/mbed-client-cli/* | |
78 | ||
79 | see https://docs.platformio.org/en/latest/frameworks/mbed.html#ignoring-particular-components |