aboutsummaryrefslogtreecommitdiff
path: root/projects/hsm
diff options
context:
space:
mode:
Diffstat (limited to 'projects/hsm')
-rw-r--r--projects/hsm/hsm.c1
-rw-r--r--projects/hsm/log.c4
-rw-r--r--projects/hsm/mgmt-cli.c6
-rw-r--r--projects/hsm/mgmt-masterkey.c4
-rw-r--r--projects/hsm/mgmt-misc.c8
5 files changed, 11 insertions, 12 deletions
diff --git a/projects/hsm/hsm.c b/projects/hsm/hsm.c
index a36c64b..7fc7410 100644
--- a/projects/hsm/hsm.c
+++ b/projects/hsm/hsm.c
@@ -409,7 +409,6 @@ void hal_sleep(const unsigned seconds) { task_delay(seconds * 1000); }
int main(void)
{
stm_init();
- uart_set_default(STM_UART_MGMT);
led_on(LED_GREEN);
if (hal_rpc_server_init() != LIBHAL_OK)
diff --git a/projects/hsm/log.c b/projects/hsm/log.c
index c0d9df4..fbc0e73 100644
--- a/projects/hsm/log.c
+++ b/projects/hsm/log.c
@@ -63,6 +63,6 @@ void hal_log(const hal_log_level_t level, const char *format, ...)
vsnprintf(buffer, sizeof(buffer), format, ap);
va_end(ap);
- uart_send_string2(STM_UART_MGMT, buffer);
- uart_send_string2(STM_UART_MGMT, "\r\n");
+ uart_send_string(buffer);
+ uart_send_string("\r\n");
}
diff --git a/projects/hsm/mgmt-cli.c b/projects/hsm/mgmt-cli.c
index 23a0a40..2b5be1f 100644
--- a/projects/hsm/mgmt-cli.c
+++ b/projects/hsm/mgmt-cli.c
@@ -112,8 +112,8 @@ void HAL_UART1_RxCpltCallback(UART_HandleTypeDef *huart)
static void uart_cli_print(struct cli_def *cli __attribute__ ((unused)), const char *buf)
{
char crlf[] = "\r\n";
- uart_send_string2(STM_UART_MGMT, buf);
- uart_send_string2(STM_UART_MGMT, crlf);
+ uart_send_string(buf);
+ uart_send_string(crlf);
}
static ssize_t uart_cli_read(struct cli_def *cli __attribute__ ((unused)), void *buf, size_t count)
@@ -127,7 +127,7 @@ static ssize_t uart_cli_read(struct cli_def *cli __attribute__ ((unused)), void
static ssize_t uart_cli_write(struct cli_def *cli __attribute__ ((unused)), const void *buf, size_t count)
{
- uart_send_bytes(STM_UART_MGMT, (uint8_t *) buf, count);
+ uart_send_bytes((uint8_t *) buf, count);
return (ssize_t)count;
}
diff --git a/projects/hsm/mgmt-masterkey.c b/projects/hsm/mgmt-masterkey.c
index 8675637..765cb10 100644
--- a/projects/hsm/mgmt-masterkey.c
+++ b/projects/hsm/mgmt-masterkey.c
@@ -111,7 +111,7 @@ static int _masterkey_set(struct cli_def *cli, char *argv[], int argc,
return CLI_ERROR;
}
cli_print(cli, "Random key:\n");
- uart_send_hexdump(STM_UART_MGMT, buf, 0, sizeof(buf) - 1);
+ uart_send_hexdump(buf, 0, sizeof(buf) - 1);
cli_print(cli, "\n");
}
@@ -122,7 +122,7 @@ static int _masterkey_set(struct cli_def *cli, char *argv[], int argc,
}
cli_print(cli, "Parsed key:\n");
- uart_send_hexdump(STM_UART_MGMT, buf, 0, sizeof(buf) - 1);
+ uart_send_hexdump(buf, 0, sizeof(buf) - 1);
cli_print(cli, "\n");
}
diff --git a/projects/hsm/mgmt-misc.c b/projects/hsm/mgmt-misc.c
index 65da7ff..b06003f 100644
--- a/projects/hsm/mgmt-misc.c
+++ b/projects/hsm/mgmt-misc.c
@@ -60,7 +60,7 @@ int cli_receive_data(struct cli_def *cli, uint8_t *buf, size_t len, cli_data_cal
cli_print(cli, "OK, write size (4 bytes), data in %li byte chunks, CRC-32 (4 bytes)", (uint32_t) n);
- if (uart_receive_bytes(STM_UART_MGMT, (void *) &filesize, sizeof(filesize), 2000) != CMSIS_HAL_OK) {
+ if (uart_receive_bytes((void *) &filesize, sizeof(filesize), 2000) != CMSIS_HAL_OK) {
cli_print(cli, "Receive timed out");
goto fail;
}
@@ -75,7 +75,7 @@ int cli_receive_data(struct cli_def *cli, uint8_t *buf, size_t len, cli_data_cal
if (filesize < n) n = filesize;
- if (uart_receive_bytes(STM_UART_MGMT, (void *) buf, n, 2000) != CMSIS_HAL_OK) {
+ if (uart_receive_bytes((void *) buf, n, 2000) != CMSIS_HAL_OK) {
cli_print(cli, "Receive timed out");
goto fail;
}
@@ -91,12 +91,12 @@ int cli_receive_data(struct cli_def *cli, uint8_t *buf, size_t len, cli_data_cal
}
counter++;
- uart_send_bytes(STM_UART_MGMT, (void *) &counter, 4);
+ uart_send_bytes((void *) &counter, 4);
}
my_crc = hal_crc32_finalize(my_crc);
cli_print(cli, "Send CRC-32");
- uart_receive_bytes(STM_UART_MGMT, (void *) &crc, sizeof(crc), 2000);
+ uart_receive_bytes((void *) &crc, sizeof(crc), 2000);
cli_print(cli, "CRC-32 0x%x, calculated CRC 0x%x", (unsigned int) crc, (unsigned int) my_crc);
if (crc == my_crc) {
cli_print(cli, "CRC checksum MATCHED");