diff --git a/README.md b/README.md index 01424d327..9652d865b 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ cd trezor-core sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install scons libsdl2-dev:i386 libsdl2-image-dev:i386 gcc-multilib +pip install ed25519 pyblake2 make build_unix ``` diff --git a/docs/hardware.md b/docs/hardware.md index cb2fdfebf..3cb4074be 100644 --- a/docs/hardware.md +++ b/docs/hardware.md @@ -19,10 +19,9 @@ TODO ## Developer Kit -* 1 x [Waveshare Core405R Dev Board](http://www.waveshare.com/core405r.htm) +* 1 x [STM32F407G-DISC1](http://www.st.com/en/evaluation-tools/stm32f4discovery.html) * 1 x USB Cable Type A Plug/Male to Type Mini-B Plug/Male -* 1 x ST-LINK V2 STM32 USB Debug Adapter -* Female to female jumper wires with 0.1" header contacts +* 1 x USB Cable Type A Plug/Male to Type Micro-B Plug/Male * 1 x Display * 1 x Capacitive Touch Panel / Sensor * 1 x microSD Socket @@ -38,27 +37,27 @@ TODO ##### Pinout -|Description|MCU Pin| -|-----------|-------| -|LCD_RST|PC14| -|LCD_FMARK|PD12 [TODO: what is this for?]| -|LCD_PWM|PB13 [TODO: what is this for?]| -|LCD_CS|PD7| -|LCD_RS|PD11| -|LCD_RD|PD4| -|LCD_WR|PD5| -|LCD_D0|PD14| -|LCD_D1|PD15| -|LCD_D2|PD0| -|LCD_D3|PD1| -|LCD_D4|PE7| -|LCD_D5|PE8| -|LCD_D6|PE9| -|LCD_D7|PE10| +|Description|MCU Pin|Notes| +|-----------|-------|-----| +|LCD_RST|PC14|| +|LCD_FMARK|PD12|tearing effect input| +|LCD_PWM|PB13|backlight control (brightness)| +|LCD_CS|PD7|| +|LCD_RS|PD11|register select aka command/data| +|LCD_RD|PD4|| +|LCD_WR|PD5|| +|LCD_D0|PD14|| +|LCD_D1|PD15|| +|LCD_D2|PD0|| +|LCD_D3|PD1|| +|LCD_D4|PE7|| +|LCD_D5|PE8|| +|LCD_D6|PE9|| +|LCD_D7|PE10|| #### Capacitive Touch Panel / Sensor * Bus/Interface: I2C -* Driver IC: FT6206 [TODO: does this matter] +* Driver IC: FT6206 [TODO: does this matter?] * single touch ##### Pinout @@ -97,6 +96,7 @@ TODO #### Dev Board * [Schematic](http://www.waveshare.com/w/upload/0/05/CorexxxR-Schematic.pdf) -* [STM32F405RGT6](http://www.st.com/en/microcontrollers/stm32f405rg.html) +* [STM32F407VGT6](http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32f4-series/stm32f407-417/stm32f407vg.html) * HSE / High-Speed External Crystal: 8 MHz +* Integrated STMicroelectronics ST-LINK/V2.1 debugger diff --git a/embed/extmod/modtrezorui/display-stm32.h b/embed/extmod/modtrezorui/display-stm32.h index f4ce24532..133b342ca 100644 --- a/embed/extmod/modtrezorui/display-stm32.h +++ b/embed/extmod/modtrezorui/display-stm32.h @@ -134,14 +134,14 @@ int display_init(void) { HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); HAL_GPIO_WritePin(GPIOC, GPIO_PIN_14, GPIO_PIN_SET); - // LCD_FMARK/PD12 + // LCD_FMARK/PD12 (tearing effect) GPIO_InitStructure.Pin = GPIO_PIN_12; GPIO_InitStructure.Mode = GPIO_MODE_INPUT; GPIO_InitStructure.Pull = GPIO_NOPULL; GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH; HAL_GPIO_Init(GPIOD, &GPIO_InitStructure); - // LCD_PWM/PB13 + // LCD_PWM/PB13 (backlight control) GPIO_InitStructure.Mode = GPIO_MODE_AF_PP; GPIO_InitStructure.Pull = GPIO_NOPULL; GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH; @@ -224,7 +224,7 @@ int display_init(void) { CMD(0x01); // software reset HAL_Delay(20); CMD(0x28); // display off - CMD(0xCF); DATA(0x00); DATA(0xC1); DATA(0x30; + CMD(0xCF); DATA(0x00); DATA(0xC1); DATA(0x30); CMD(0xED); DATA(0x64); DATA(0x03); DATA(0x12); DATA(0x81); CMD(0xE8); DATA(0x85); DATA(0x10); DATA(0x7A); CMD(0xCB); DATA(0x39); DATA(0x2C); DATA(0x00); DATA(0x34); DATA(0x02); @@ -288,6 +288,7 @@ static void display_set_window(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y } void display_refresh(void) { + // synchronize with the panel synchronization signal in order to avoid visual tearing effects while (GPIO_PIN_RESET == HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_12)) { } while (GPIO_PIN_SET == HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_12)) { } }