Logo-amall

Port an IoT aplication into Luos framework.

Last active 3 months ago

18 replies

10 views

  • CE

    Hello all! I'm trying to port an IoT aplication into Luos framework. I used LED example for L432KC. I've changed the ports for LED / Button and compiled using PlatformIO. However I've two problems:

    1. When using PlatformIO upload I get unable to reset target error. If I press the reset button while uploading, I'm able to upload the firmware.

    2. The LED doesn't blink, gate is not detected from pyluos. I think my device gets stuck on HardFault_Handler.

    I've checked on node_config.h but default configuration seems fine as L432 board is mostly similar to L475E. Does anyone knows from where can I start to work for making this board Luos compatible? I've tried to check the call stack but no info.

  • MA

    Hey @mention thanks for your post! I think @mention and @mention can help you a lot!

  • NI

    Did you select the good board on the plarformio.ini?

  • CE

    Yep, followed this instructions: https://docs.platformio.org/en/stable/boards/ststm32/discol475vgiot01a.html

  • NI

    The thing about the reset button is strange, you shouldn't have to do some strange things to flash. Is the debug working?

  • NI

    Can you give us your 'node_config.h' ?

  • SA
    1. sometimes it may happen! can you try to use the stm tools "STM32 ST-LINK Utility" and see if you have the same problem to be connected to the board? try to full erase flash and retry to connect with pio

    2.it possible that the pipe has not the same configuration (on DMA channel and DMA request) let me check that for you and I give you a feedback asap

  • CE

    Hi @mention! Thanks for your help, it was very usefull.
    1) I've erased full flash memory and still the same issue. No other software is using virtual com, so still the same situation.

    2) LED example is running fine, however the gate can't be located through pyluos-shell. I've changed some settings but still struggling with the node_config.h. Do you know if I should change something on the DMA as you suggested previously?

    Here are my changes on node_config.h.

    ```#define PORTCLOCKENABLE _HALRCCGPIOBCLK_ENABLE

    define COMTXPORT GPIOB

    define COMTXPIN GPIOPIN6

    define COMRXPORT GPIOB

    define COMRXPIN GPIOPIN7

    define LUOSCOMCLOCK_ENABLE _HALRCCUSART1CLK_ENABLE

    define LUOS_COM USART1

    define LUOSCOMIRQ USART1_IRQn

    define LUOSCOMIRQHANDLER USART1_IRQHandler```

    I had to change USART ports on the Pipe config also as they wasn't defined on the HAL.

    ```

    ifndef PIPE_CONFIG

    #define PIPE_TX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE();
    #define PIPE_TX_PIN   GPIO_PIN_6
    #define PIPE_TX_PORT  GPIOB
    #define PIPE_TX_AF    GPIO_AF7_USART1 //GPIO_AF7_USART2
    
    #define PIPE_RX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE();
    #define PIPE_RX_PIN   GPIO_PIN_7
    #define PIPE_RX_PORT  GPIOB
    #define PIPE_RX_AF    GPIO_AF7_USART1 //GPIO_AF3_USART2
    
    #define PIPE_COM_CLOCK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE()
    #define PIPE_COM                USART2
    #define PIPE_COM_IRQ            USART2_IRQn
    #define PIPE_COM_IRQHANDLER()   USART2_IRQHandler()
    
    ...
    

    endif```

  • SA

    Ok I will try to find and test the différents configuration

  • SA

    OK the Luos configuration and the pipe configuration is not the same!
    lets start with Luos redefine in the nodeconfig.h: you should define only what you need redefine don't forget that will replace the default configuration so you have to match the default configuration and your configuration check pinout, port, clock. for usart check pinout matching with usart and alternate fonction etc you can check exemple here and check node config that should be very close to you config https://github.com/Luos-io/luosengine/tree/main/examples/projects/STM32L4S5discovery/gateserialcom

  • SA

    can you make an inventory of the pin that you want to use on your board and I will check want is the corresponding config

  • SA

    For Pipe you should use the on board usb :
    the pipe must be on a other usart than luos network usart you must check board datasheet

  • SA

    I will order this board to try to make you a config

  • SA

    From what I see the configuration of the l475 is very close to the L4S5 evaluation board and we have some exemple for these board! you should take the node config of the project gate_serialcom and put in you project!

  • SA

    luos com is on CN3 connector

    6 PB4 : Rx en
    5 PA3 : Tx en
    4 PB0 : PTPB
    3 PD14 : PTPB
    2 TX PA0 UART4TX 1 RX PA1 UART4RX

  • SA

    for pipe you can connect directly to the usb build in!

  • 0X

    My dream board from STMicro

  • 0X

    I might know few ppl that got that board

Last active 3 months ago

18 replies

10 views