Announcement

Collapse
No announcement yet.

Integrating with STM32

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Integrating with STM32

    Hi,

    I'm new to 4dsystems LCD, I have a gen4 ulcd32DT, and I figured out how to transmit data from STM to LCD but not the opposite.
    I tried HAL_UART_Receive(), HAL_UART_Receive_IT(), HAL_UART_Receive_DMA() without sucess and my buffer still equals 0.

    First , is STM32 totally compatible with 4DLCD ?
    Second, if so, how does it work ?




    there is my simplified code :

    uint8_t button[6] = {0x07, 0x1E, 0x00, 0x00, 0x00, 0x19}; //it is what i get when i tuch the button on Gtx tool

    while(1){

    HAL_UART_Receive_IT(&huart1,&UART_buffer,6);

    if(UART_buffer == bouton){
    HAL_GPIO_TogglePin(GPIOA, LD2_Pin);
    HAL_GPIO_TogglePin(RELAI_GPIO_Port, RELAI_Pin);
    }
    }

    Thanks for your help

    Samuel

  • #2
    Hello Samuel,

    Welcome to the forum,

    The STM32 as a micro-controller with Serial is compatible. There seem to be many issues online about receiving serial and interrupt priority. DMA seems to work for many users but only if DMA is limited to Serial. I will do a bit more digging to see if I can find a solution.

    Best regards

    Paul

    Comment


    • #3
      Hi Samuel,

      If you transmitted data to the display, the display will return an ACK (0x06). The recevied ACK's are most likely in the receive buffer already. It would be normal to send a command to the display and then check for a received ACK and then when checking for incoming data it would remain in sync.

      I hope this helps

      Best regards

      Paul

      Comment


      • #4
        Hi Paul,

        First, thanks for your reply.

        But i don't want to check if i really transmitted to LCD with ACK, I want to receive an hexa in my buffer from the LCD button i just pressed. Then test if this buffer equals to 0x071E00000019. If so, toggle a LED.


        My goal is to toggle a physical LED with a fictive button.

        Samuel

        Comment


        • #5
          Hi Samuel,

          Thanks for getting back to me.

          If there is no TX to the LCD then it shouldn't matter about the ACK as the display won't need to acknowledge a command sent so 0x06 wouldn't be in the buffer but if you have sent a message to display an object then the ACK would be returned and in the buffer.

          On some of the issues I have read about STM32 Serial RX, some users have noticed that just the first byte is received. I will look to see if there is some example code.

          Best regards

          Paul

          Comment


          • #6
            Hey,

            I'm looking for some solutions on the internet but I'm not finding a lot of posts about STM32 and 4DSystems devices.
            I'll wait until tomorrow morning to see with a competent colleague if he has any help for my problem.
            Anyway, if you find example code, i would be glad if you share it.

            Regards

            Samuel

            Comment


            • #7
              Originally posted by sam42 View Post
              Hey,

              I'm looking for some solutions on the internet but I'm not finding a lot of posts about STM32 and 4DSystems devices.
              I'll wait until tomorrow morning to see with a competent colleague if he has any help for my problem.
              Anyway, if you find example code, i would be glad if you share it.

              Regards

              Samuel
              I haven't found anything yet but will keep looking

              Comment

              Working...
              X