stm32-alternate042.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef __BOARD_H__
  2. #define __BOARD_H__
  3. #include <stdbool.h>
  4. #include <libopencm3/stm32/rcc.h>
  5. #include <libopencm3/stm32/gpio.h>
  6. /*
  7. * Board definitions for STM32 Alternate042
  8. * It is a reused PCB left from the IRUSB project.
  9. * The board uses the same CPU as the stm32-tiny042 project, but in a 32 pin
  10. * package.
  11. * Instead of PORTA pins 0 to 7, PORTA pins 1 to 8 are on a pin header.
  12. * Instead of a LED on port A GPIO14, its on GPIO15. It will be on if a high
  13. * level is applied.
  14. * The hardware supports SPI frequencies from 187.5kHz to 24MHz in power-of-two
  15. * steps.
  16. *
  17. * For flashing, close jumper J4 (connects BOOT pin to Vcc) and call
  18. * dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D stm32-vserprog.bin
  19. *
  20. * Connection:
  21. * Flash Chip: STM32:
  22. * CS PORTA pin 4 - SPI1_NSS
  23. * SCK PORTA pin 5 - SPI1_SCK
  24. * SO or DO PORTA pin 6 - SPI1_MISO
  25. * SI or DI PORTA pin 7 - SPI1_MOSI
  26. * HOLD# Vcc=3.3V
  27. * WP# For some reason the winbond chip only gave reliable results when
  28. * connected to GND.
  29. *
  30. * Tested Flash chips:
  31. * 8MBit: Winbond W25Q80BV -> detected as W25Q80.V, works with 24MHz, even when
  32. * the clock looks more like a sine on a breadboard.
  33. * 16MBit: Macronix MX25L1606E -> the signature fits to three different chips.
  34. * Set to "MX25L1605A/MX25L1606E/MX25L1608E". Has bit erros at 24MHz.
  35. * Reads reliable with the slower frequencies. I would use 1.5MHz.
  36. * Reading speed:
  37. * 375kHz: 46s.
  38. * 750kHz: 24s
  39. * 1.5MHz: 14s
  40. * 3MHz: 12s
  41. * Faster frequencies don't improve the reading speed.
  42. *
  43. * The board can be found at:
  44. * https://github.com/Solartraveler/irusb
  45. */
  46. #define BOARD_USE_DEBUG_PINS_AS_GPIO false
  47. #define BOARD_RCC_LED RCC_GPIOA
  48. #define BOARD_PORT_LED GPIOA
  49. #define BOARD_PIN_LED GPIO15
  50. #define BOARD_LED_HIGH_IS_BUSY false /* Only LED, high active, use as idle. */
  51. /* STM32F0x2 has internal USB pullup. */
  52. /* Currently you can only use SPI1. */
  53. #endif /* __BOARD_H__ */