aboutsummaryrefslogtreecommitdiff
path: root/projects/hsm
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2017-05-02 17:10:02 -0400
committerPaul Selkirk <paul@psgd.org>2017-05-02 17:10:02 -0400
commit1175ff63f2a8c4762692551403862f9f0789aef8 (patch)
treed7d004e639ffa35296b6c91a64711bcc34f63a9b /projects/hsm
parent716694ae77259e31526a6d64db867ced5c231ced (diff)
Merge branch 'init_cleanup' into no-rtos
Clean up Makefiles and initialization code.
Diffstat (limited to 'projects/hsm')
-rw-r--r--projects/hsm/Makefile14
-rw-r--r--projects/hsm/hsm.c4
-rw-r--r--projects/hsm/mgmt-misc.c6
3 files changed, 10 insertions, 14 deletions
diff --git a/projects/hsm/Makefile b/projects/hsm/Makefile
index 59bad25..927c9f1 100644
--- a/projects/hsm/Makefile
+++ b/projects/hsm/Makefile
@@ -2,13 +2,13 @@ PROJ = hsm
# objs in addition to $(PROJ).o
OBJS = mgmt-cli.o \
- mgmt-firmware.c \
- mgmt-bootloader.c \
- mgmt-fpga.c \
- mgmt-keystore.c \
- mgmt-masterkey.c \
- mgmt-misc.c \
- mgmt-task.c \
+ mgmt-firmware.o \
+ mgmt-bootloader.o \
+ mgmt-fpga.o \
+ mgmt-keystore.o \
+ mgmt-masterkey.o \
+ mgmt-misc.o \
+ mgmt-task.o \
log.o
BOARD_OBJS += $(TOPLEVEL)/task.o
diff --git a/projects/hsm/hsm.c b/projects/hsm/hsm.c
index 55c41db..8a8f441 100644
--- a/projects/hsm/hsm.c
+++ b/projects/hsm/hsm.c
@@ -397,11 +397,7 @@ int main(void)
{
stm_init();
uart_set_default(STM_UART_MGMT);
-
led_on(LED_GREEN);
- /* Prepare FMC interface. */
- fmc_init();
- sdram_init();
if (hal_rpc_server_init() != LIBHAL_OK)
Error_Handler();
diff --git a/projects/hsm/mgmt-misc.c b/projects/hsm/mgmt-misc.c
index 1861304..ccd032b 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), 1000) != CMSIS_HAL_OK) {
+ if (uart_receive_bytes(STM_UART_MGMT, (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, 1000) != CMSIS_HAL_OK) {
+ if (uart_receive_bytes(STM_UART_MGMT, (void *) buf, n, 2000) != CMSIS_HAL_OK) {
cli_print(cli, "Receive timed out");
goto fail;
}
@@ -96,7 +96,7 @@ int cli_receive_data(struct cli_def *cli, uint8_t *buf, size_t len, cli_data_cal
my_crc = hal_crc32_finalize(my_crc);
cli_print(cli, "Send CRC-32");
- uart_receive_bytes(STM_UART_MGMT, (void *) &crc, sizeof(crc), 1000);
+ uart_receive_bytes(STM_UART_MGMT, (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");