aboutsummaryrefslogtreecommitdiff
path: root/libraries/mbed/Makefile
blob: 9d68e923db755b5d86a2ada7f37f87989b33c6db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
CC=arm-none-eabi-gcc
AR=arm-none-eabi-ar

###########################################

vpath %.c targets/cmsis/TARGET_STM/TARGET_STM32F4 targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_DEV_BRIDGE

SRCS =	stm32f4xx_hal.c \
	stm32f4xx_hal_adc.c \
	stm32f4xx_hal_adc_ex.c \
	stm32f4xx_hal_can.c \
	stm32f4xx_hal_cec.c \
	stm32f4xx_hal_cortex.c \
	stm32f4xx_hal_crc.c \
	stm32f4xx_hal_cryp.c \
	stm32f4xx_hal_cryp_ex.c \
	stm32f4xx_hal_dac.c \
	stm32f4xx_hal_dac_ex.c \
	stm32f4xx_hal_dcmi.c \
	stm32f4xx_hal_dcmi_ex.c \
	stm32f4xx_hal_dma2d.c \
	stm32f4xx_hal_dma.c \
	stm32f4xx_hal_dma_ex.c \
	stm32f4xx_hal_dsi.c \
	stm32f4xx_hal_eth.c \
	stm32f4xx_hal_flash.c \
	stm32f4xx_hal_flash_ex.c \
	stm32f4xx_hal_flash_ramfunc.c \
	stm32f4xx_hal_fmpi2c.c \
	stm32f4xx_hal_fmpi2c_ex.c \
	stm32f4xx_hal_gpio.c \
	stm32f4xx_hal_hash.c \
	stm32f4xx_hal_hash_ex.c \
	stm32f4xx_hal_hcd.c \
	stm32f4xx_hal_i2c.c \
	stm32f4xx_hal_i2c_ex.c \
	stm32f4xx_hal_i2s.c \
	stm32f4xx_hal_i2s_ex.c \
	stm32f4xx_hal_irda.c \
	stm32f4xx_hal_iwdg.c \
	stm32f4xx_hal_lptim.c \
	stm32f4xx_hal_ltdc.c \
	stm32f4xx_hal_ltdc_ex.c \
	stm32f4xx_hal_msp_template.c \
	stm32f4xx_hal_nand.c \
	stm32f4xx_hal_nor.c \
	stm32f4xx_hal_pccard.c \
	stm32f4xx_hal_pcd.c \
	stm32f4xx_hal_pcd_ex.c \
	stm32f4xx_hal_pwr.c \
	stm32f4xx_hal_pwr_ex.c \
	stm32f4xx_hal_qspi.c \
	stm32f4xx_hal_rcc.c \
	stm32f4xx_hal_rcc_ex.c \
	stm32f4xx_hal_rng.c \
	stm32f4xx_hal_rtc.c \
	stm32f4xx_hal_rtc_ex.c \
	stm32f4xx_hal_sai.c \
	stm32f4xx_hal_sai_ex.c \
	stm32f4xx_hal_sd.c \
	stm32f4xx_hal_sdram.c \
	stm32f4xx_hal_smartcard.c \
	stm32f4xx_hal_spdifrx.c \
	stm32f4xx_hal_spi.c \
	stm32f4xx_hal_sram.c \
	stm32f4xx_hal_tim.c \
	stm32f4xx_hal_tim_ex.c \
	stm32f4xx_hal_uart.c \
	stm32f4xx_hal_usart.c \
	stm32f4xx_hal_wwdg.c \
	stm32f4xx_ll_fmc.c \
	stm32f4xx_ll_fsmc.c \
	stm32f4xx_ll_sdmmc.c \
	stm32f4xx_ll_usb.c \
	cmsis_nvic.c \
	hal_tick.c

OBJS = $(SRCS:.c=.o)

all: libstmf4.a

libstmf4.a: $(OBJS)
	$(AR) -r $@ $(OBJS)

clean:
	rm -f $(OBJS) libstmf4.a
s="w"> "HSE_VALUE: %li", HSE_VALUE); cli_print(cli, "HCLK: %li (%i MHz)", hclk, (int) hclk / 1000 / 1000); cli_print(cli, "SystemCoreClock: %li (%i MHz)", SystemCoreClock, (int) SystemCoreClock / 1000 / 1000); return CLI_OK; } static int cmd_show_fpga_status(struct cli_def *cli, const char *command, char *argv[], int argc) { cli_print(cli, "FPGA has %sloaded a bitstream", fpgacfg_check_done() ? "":"NOT "); return CLI_OK; } static int cmd_show_keystore_status(struct cli_def *cli, const char *command, char *argv[], int argc) { cli_print(cli, "Keystore memory is %sonline", (keystore_check_id() != 1) ? "NOT ":""); return CLI_OK; } static int cmd_show_keystore_data(struct cli_def *cli, const char *command, char *argv[], int argc) { uint8_t buf[KEYSTORE_PAGE_SIZE]; uint32_t i; if (keystore_check_id() != 1) { cli_print(cli, "ERROR: The keystore memory is not accessible."); } memset(buf, 0, sizeof(buf)); if ((i = keystore_read_data(0, buf, sizeof(buf))) != 1) { cli_print(cli, "Failed reading first page from keystore memory: %li", i); return CLI_ERROR; } cli_print(cli, "First page from keystore memory:\r\n"); uart_send_hexdump(STM_UART_MGMT, buf, 0, sizeof(buf) - 1); uart_send_string2(STM_UART_MGMT, (char *) "\r\n\r\n"); for (i = 0; i < 8; i++) { if (buf[i] == 0xff) break; /* never written */ if (buf[i] != 0x55) break; /* something other than a tombstone */ } /* As a demo, tombstone byte after byte of the first 8 bytes in the keystore memory * (as long as they do not appear to contain real data). * If all of them are tombstones, erase the first sector to start over. */ if (i < 8) { if (buf[i] == 0xff) { cli_print(cli, "Tombstoning byte %li", i); buf[i] = 0x55; if ((i = keystore_write_data(0, buf, sizeof(buf))) != 1) { cli_print(cli, "Failed writing data at offset 0: %li", i); return CLI_ERROR; } } } else { cli_print(cli, "Erasing first sector since all the first 8 bytes are tombstones"); if ((i = keystore_erase_sectors(1, 1)) != 1) { cli_print(cli, "Failed erasing the first sector: %li", i); return CLI_ERROR; } cli_print(cli, "Erase result: %li", i); } return CLI_OK; } void configure_cli_show(struct cli_def *cli) { /* show */ cli_command_root(show); /* show cpuspeed */ cli_command_node(show, cpuspeed, "Show the speed at which the CPU currently operates"); cli_command_branch(show, fpga); /* show fpga status*/ cli_command_node(show_fpga, status, "Show status about the FPGA"); cli_command_branch(show, keystore); /* show keystore status*/ cli_command_node(show_keystore, status, "Show status of the keystore memory"); cli_command_node(show_keystore, data, "Show the first page of the keystore memory"); }