README.md

Mon, 11 Mar 2024 15:35:36 +0100

author
David Douard <david.douard@sdf3.org>
date
Mon, 11 Mar 2024 15:35:36 +0100
changeset 71
d193c24a078a
parent 59
b4ce7147f82c
permissions
-rw-r--r--

Add links to sr.ht repos and add an image in the README file

# Replacement front panel for the HP/Agilent 34970A - firmware


![HP34970A with new front panel](https://whatever.sdfa3.org/images/hp34970a/derivatives/large-photo/800w/finished.jpg)

This repository contains the firmware for the replacement front panel for the
HP 34970A acuisition unit described
[here](https://whatever.sdfa3.org/hp-34970a-data-acquisition-unit-part-5.html)

The kicad project for the PCB design is [located here](https://git.sr.ht/~douardda/hp34970-pcb).
 
It is based on the [Mbed-os](https://os.mbed.com) framework and uses the
[platformio](https://platformio.org/) development environment.

Make sure to have this later properly installed (I suggest you install it in a
Python 3 virtualenv).

The firmware has been developped using platformio version 5.0.3 and Mbed-os 6.2.

## Compilation

It should be a simple matter of calling:

```
(pio3) ~/p/p/hp34970disp$ pio run -e fp_dfu
[...]
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [==        ]  21.4% (used 14048 bytes from 65536 bytes)
Flash: [==        ]  22.9% (used 90040 bytes from 393216 bytes)
========================================== [SUCCESS] Took 28.13 seconds ==========================================

Environment    Status    Duration
-------------  --------  ------------
fp_dfu         SUCCESS   00:00:28.129
========================================== 1 succeeded in 00:00:28.129 ==========================================

```

Note: the `platformio.ini` provides 2 similar environments (`fp_dfu` and
`fp_stlink`) which are identical but the `upload_protocol`.

## Uploading the firmware

You can upload the firmware either via the (USB) DFU mode or the SWD/STLink
port on the PCB. Note that the USB socket on the PCB does not power the board,
so it must be already powered (which is typically when the board is connected
to the main CPU board of the HP 34970A).

In order to be able to upload the firware by DFU, the STM32 MCU on the front
panel must be booted in DFU mode, which can be done by pressing the DFU button,
then the RESET button while keeping the DFU pressed.

The STLink upload method does not need the board o be booted in DFU mode.

```
(pio3) ~/p/p/hp34970disp$ pio run -e fp_dfu -t upload
```

or

```
(pio3) ~/p/p/hp34970disp$ pio run -e fp_stlink -t upload
```

## Credits

THis firmware uses a modified version of the [UniGraphic]() library and the
[QEI]() library.


## Notes (deprecated)

Use mbed 6

For some reason I had to disable mbed-client-cli/ (multiple definition of `cmd' error at
link time).
Put a .mbedignore file in:

$ cd /home/david/.platformio/packages/framework-mbed@6.51504.200716/features
$ cat .mbedignore
mbed-client-cli/*
frameworks/mbed-client-cli/*

see https://docs.platformio.org/en/latest/frameworks/mbed.html#ignoring-particular-components

mercurial