You are reading a single comment by @CKnight and its replies. Click here to read the full conversation.
  • Hi,

    I'm trying to utilize Espruino on the larger STM32F405 package, and having some trouble with getting it to even boot. I've been able to successfully compile and load espruino to an STM32F4DISOVERY on a ubuntu box, and I've also got an Espruino board coming from adafruit to play with directly (I want to see how it does as a nice little protocol tester for some of my devices), but the migration to the larger package for a design already in place is just leaving me puzzled.

    I believe I've changed the basic required information to what's needed, and didn't see anything that was obvious in the target libraries (although I could be overlooking an HSE adjustment there?).
    Main differences:

    1. The larger package.
    2. The board uses a 16Mhz oscillator.
    3. Some things like the SD card have different connections so I've left them undefined for now.

    I've taken a few bits and pieces from the smartwatch board configuration to account for the speed change, but it looks to need some heavy updating, so I don't know if that was the best move.

    T2_STM32F4.py pertinent info

    import pinutils;
    info = {
     'name' : "T2 STM32F4",
     'link' :  [ "http://www.st.com/web/catalog/mmc/FM141­/SC1169/SS1577/LN1035/PF252138" ],
     'default_console' : "EV_SERIAL3", # USART3 by default. USART6 goes to the embedded modem
     'default_console_tx' : "B10", # USART3_TX on PB10
     'default_console_rx' : "B11", # USART3_RX on PB11
     'default_console_baudrate' : "115200", # Baudrate default
     'variables' : 5450, [#Leaving](http://forum.espruino.com/sea­rch/?q=%23Leaving) it same as the discovery.
     'binary_name' : 'espruino_%v_T2stm32f4.bin',
    };
    chip = {
      'part' : "STM32F405ZGT6",
      'family' : "STM32F4",
      'package' : "LQFP144",
      'hse' : 16000000, # oscillator
      'ram' : 192,
      'flash' : 1024,
      'speed' : 168,
      'usart' : 6,
      'spi' : 3,
      'i2c' : 3,
      'adc' : 3,
      'dac' : 2,
    };
    # left-right, or top-bottom order
    board = {
    };
    devices = {
      'OSC' : { 'pin_1' : 'H0',
                'pin_2' : 'H1' },
      'OSC_RTC' : { 'pin_1' : 'C14',
                    'pin_2' : 'C15' },
      'LED1' : { 'pin' : 'E12' },
      'LED2' : { 'pin' : 'E13' },
      'LED3' : { 'pin' : 'E14' },
      #'LED4' : { 'pin' : 'D15' },
      #'BTN1' : { 'pin' : 'A0' },
      'USB' : { #'pin_otg_pwr' : 'E14',
                'pin_dm' : 'A11',
                'pin_dp' : 'A12',
                'pin_vbus' : 'A9',
                'pin_id' : 'A10', },
      #'SD' :  { 'pin_cs' :  'D2',
      #          'pin_di' :  'B15',
      #          'pin_do' :  'B14',
      #          'pin_clk' :  'B13' }, 
      #'MEMS' :  {  'device' : 'LIS302DL',
      #          'pin_cs' :  'E3',
      #          'pin_int1' :  'E0',
      #          'pin_int2' :  'E1',
      #          'pin_mosi' :  'A7',
      #          'pin_miso' :  'A6',
      #          'pin_sck' :  'A5' },
      #'MIC' :  { 'device' : 'MP45DT02',
      #           'pin_clk' :  'C3',
      #           'pin_dout' :  'B10', },
      #'AUDIO' :  { 'device' : 'CS43L22',
      #             'pin_sda' :  'B9',
      #             'pin_scl' :  'B6',
      #             'pin_mclk' :  'C7',
      #             'pin_sclk' :  'C10',   
      #             'pin_sdin' :  'C12', 
      #             'pin_lrck' :  'A4',
      #             'pin_nrst' :  'D4',   
      #              },
    };
    
    
    board_css = """
    """;
    
    def get_pins():
      pins = pinutils.scan_pin_file([], 'stm32f40x.csv', 6, 9, 10)
      return pinutils.only_from_package(pinutils.fill­_gaps_in_pin_list(pins), chip["package"])
    

    Makefile pertinent info

    else ifdef T2_STM32F4
    EMBEDDED=1
    DEFINES += -DUSE_USB_OTG_FS=1
    DEFINES+=-DHSE_VALUE=16000000UL
    BOARD=T2_STM32F4
    STLIB=STM32F40_41xxx
    PRECOMPILED_OBJS+=$(ROOT)/targetlibs/stm­32f4/lib/startup_stm32f40_41xxx.o
    OPTIMIZEFLAGS+=-O3
    

    I checked the generated pin information and it appears to be okay. Some oddities are the pin labels like below though... although below it shows the define as pin 27 and 27? PB10/PB11 are pins 69 and 70. I see the LED defines are labeled as INDEX, so I'm guessing I'm just reading this wrong and these are offsets, not the actual pin numbers. I did a sanity check with the discovery board it's similar, but just in case her's the info:

    DEFAULT_CONSOLE_DEVICE              EV_SERIAL3
    DEFAULT_CONSOLE_TX_PIN 26/* B10 */
    DEFAULT_CONSOLE_RX_PIN 27/* B11 */
    DEFAULT_CONSOLE_BAUDRATE 115200
    

    Am I missing something obvious? After a reset I get nothing out of the USB at all. The USB connections are identical to the discovery. I was going to try and remove the 16Mhz oscillator and bump it down to an 8Mhz one just in case but I figured the above should cover that.

About

Avatar for CKnight @CKnight started