add bootloader project
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
#ifndef SRC_APP_H_
|
||||
#define SRC_APP_H_
|
||||
|
||||
|
||||
|
||||
#define PRINTING_USE_VCOM
|
||||
|
||||
#define USING_DEV_BOARD
|
||||
|
@@ -311,13 +311,13 @@ void crypto_ecdsa_sign(uint8_t * data, int len, uint8_t * sig, int MBEDTLS_ECP_I
|
||||
|
||||
if ( uECC_sign(_signing_key, data, len, sig, curve) == 0)
|
||||
{
|
||||
printf("error, uECC failed\n");
|
||||
printf2(TAG_ERR,"error, uECC failed\n");
|
||||
exit(1);
|
||||
}
|
||||
return;
|
||||
|
||||
fail:
|
||||
printf("error, invalid key length\n");
|
||||
printf2(TAG_ERR,"error, invalid key length: %d\n", _key_len);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@@ -303,11 +303,52 @@ int authenticator_is_backup_initialized()
|
||||
|
||||
uint8_t adc_rng(void);
|
||||
|
||||
void bootloader_init(void)
|
||||
{
|
||||
/* Chip errata */
|
||||
|
||||
|
||||
|
||||
// status LEDS
|
||||
GPIO_PinModeSet(gpioPortF,
|
||||
4,
|
||||
gpioModePushPull,
|
||||
0);
|
||||
|
||||
GPIO_PinModeSet(gpioPortF,
|
||||
5,
|
||||
gpioModePushPull,
|
||||
1);
|
||||
|
||||
// EFM8 RDY/BUSY
|
||||
GPIO_PinModeSet(RDY_PIN, gpioModeInput, 0);
|
||||
|
||||
// EFM8 MSG Available
|
||||
GPIO_PinModeSet(MSG_AVAIL_PIN, gpioModeInput, 0);
|
||||
|
||||
// SPI R/w Indicator
|
||||
GPIO_PinModeSet(RW_PIN, gpioModePushPull, 1);
|
||||
|
||||
// USB message rdy ext int
|
||||
// GPIO_ExtIntConfig(gpioPortC, 9, 9, 1, 0,1);
|
||||
// NVIC_EnableIRQ(GPIO_ODD_IRQn);
|
||||
|
||||
|
||||
printing_init();
|
||||
|
||||
|
||||
MSC_Init();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void device_init(void)
|
||||
{
|
||||
/* Chip errata */
|
||||
|
||||
CHIP_Init();
|
||||
enter_DefaultMode_from_RESET();
|
||||
|
||||
@@ -341,6 +382,7 @@ void device_init(void)
|
||||
init_adc();
|
||||
|
||||
MSC_Init();
|
||||
|
||||
init_atomic_counter();
|
||||
if (sizeof(AuthenticatorState) > PAGE_SIZE)
|
||||
{
|
||||
@@ -360,4 +402,6 @@ void device_init(void)
|
||||
buf[i] = adc_rng();
|
||||
}
|
||||
dump_hex(buf,sizeof(buf));
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user