Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit a496103
Author: Fabio Battaglia <tabaglio@posteo.net>
Date:   Mon Jul 29 09:44:17 2024 +0200

    Increment firmware version

commit 76c6cde
Author: Fabio Battaglia <tabaglio@posteo.net>
Date:   Mon Jul 29 09:31:37 2024 +0200

    Add support for version command, removed part of boot header
  • Loading branch information
hkzlab committed Jul 29, 2024
1 parent 1eabdba commit 25ec440
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# DuPAL V3 firmware changeog
Changelog for the DuPAL V3 "dupico" board firmware.

## [0.0.3] - ????-??-??

## Added
- Command to read the firmware version

## Removed
- Removed the "Dupico FW" string at connection

## [0.0.2] - 2024-07-26

- Initial release
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ project(dupico C CXX ASM)
set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)

add_compile_definitions(FW_VERSION="0.0.2")
add_compile_definitions(FW_VERSION="0.0.3")

add_compile_definitions(USE_D_PRINTF=1)
add_compile_definitions("DEBUG=$<CONFIG:Debug>")
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ Building requires an ARM toolchain, cmake and both [FreeRTOS](https://github.com
Connecting the USB connection of the Pico to the PCB will present a virtual serial port to which you can connect. Upon connection, you should get strings similar to the following, in your terminal:

```
DuPICO - 0.0.2
REMOTE_CONTROL_ENABLED
```

Expand Down Expand Up @@ -105,6 +103,13 @@ This command forces a reset by watchdog of the dupico.

Where `x` is a code that identifies the model of the DuPAL. For dupico boards it is currently `3`.

###### Get Version

- Syntax: `>V<`
- Response: `[V x.x.x]`

Where `x.x.x` is a code the version number of the firmware.

###### Self-Test

- Syntax: `>T<`
Expand Down
14 changes: 11 additions & 3 deletions src/tasks/interface_tasks/cli_interface_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include "utils/custom_debug.h"
#include "utils/strutils.h"

#define SOFT_HEADER "\nDuPICO - " FW_VERSION "\n\n\r"

#define MODEL "3"

#define DATA_PARAMETER_SIZE (1 + 16) // a whitespace plus hex representation of a 64bit number
Expand All @@ -31,6 +29,7 @@
#define CMD_POWER 'P'
#define CMD_MODEL 'M'
#define CMD_TEST 'T'
#define CMD_VERSION 'V'

#define RESP_ERROR "CMD_ERR\n\r"
#define RESP_MODEL "[M " MODEL "]\n\r"
Expand Down Expand Up @@ -87,7 +86,6 @@ void cli_interface_task(void *params) {
buf_idx = 0;
receiving_cmd = false;

USB_PRINTF(SOFT_HEADER);
USB_PRINTF("REMOTE_CONTROL_ENABLED\r\n");
}
}
Expand Down Expand Up @@ -193,6 +191,16 @@ static void cli_parse_command(char cmd_buffer[CMD_BUFFER_SIZE], command_hub_queu

USB_PRINTF(cmd_buffer);
break;
case CMD_VERSION:
// We handle the response directly here
strncpy(cmd_buffer, " " FW_VERSION " \r\n", CMD_BUFFER_SIZE - 1);
size_t len = strnlen(cmd_buffer, CMD_BUFFER_SIZE); // Just to avoid going too far
cmd_buffer[0] = RESP_START;
cmd_buffer[1] = CMD_VERSION;
cmd_buffer[len - 3] = RESP_END;

USB_PRINTF(cmd_buffer);
break;
case CMD_RESET:
DD_PRINTF("Forcing an error state in the command hub...\r\n");
xQueueSend(queues->cmd_queue, (void*)& ((command_hub_cmd){
Expand Down

0 comments on commit 25ec440

Please sign in to comment.