embed: fix sdcard issue

pull/25/head
Pavol Rusnak 6 years ago
parent c1209dcc17
commit 08725c16e8
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -32,6 +32,7 @@
#define WANT_WRP_SECTORS (0)
#endif
// BOR LEVEL 3: Reset level threshold is around 2.5 V
#define WANT_BOR_LEVEL (OB_BOR_LEVEL3)
// reference RM0090 section 3.9.10; SPRMOD is 0 meaning PCROP disabled.; DB1M is 0 because we use 2MB dual-bank; BFB2 is 0 allowing boot from flash;

@ -70,16 +70,9 @@ static inline void sdcard_default_pin_state(void) {
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
// configure SD GPIO
#if 1
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW;
#else
GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
GPIO_InitStructure.Pull = GPIO_PULLUP;
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStructure.Alternate = GPIO_AF12_SDIO;
#endif
GPIO_InitStructure.Pin = GPIO_PIN_8 | GPIO_PIN_9 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12;
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
GPIO_InitStructure.Pin = GPIO_PIN_2;
@ -95,6 +88,7 @@ static inline void sdcard_default_pin_state(void) {
static inline void sdcard_active_pin_state(void) {
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, GPIO_PIN_RESET); // SD_ON/PC0
HAL_Delay(10); // we need to wait until the circuit fully kicks-in
GPIO_InitTypeDef GPIO_InitStructure;

@ -60,6 +60,8 @@ static inline void touch_default_pin_state(void) {
static inline void touch_active_pin_state(void) {
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_RESET); // CTP_ON/PB10
HAL_Delay(10); // we need to wait until the circuit fully kicks-in
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_5, GPIO_PIN_SET); // CTP_REST/PC5
GPIO_InitTypeDef GPIO_InitStructure;

Loading…
Cancel
Save