1 2 Previous Next 18 Replies Latest reply on Apr 20, 2016 4:16 AM by MichaelF_56 Go to original post
      • 15. Re: Unable to program BCM20736S on custom board

        I haven't used coocox and am fairly new to the STM32, but from what I've learned so far, most of it looks fine.

        The one place where I could imagine something going wrong is with your senddata function:

        what happens if your MCU is a little too busy to instantly react to the RXNE ISR?

        -> it should be called twice in a row quite quickly, or it'll skip being called once (after all, if there are 2 characters in the RX buffer, it's still "not empty" right?)

        in the first case, it'll depend on how the hardware TX is buffered. if it's just the one character, then you might overwrite that one character before it's been transmitted, if it's more, you should be fine

        in the second case, it'll depend on how the IDE, or rather the drivers you're using in that IDE: is the "IRQHandler" the actual ISR or is the IRQHandler being called by the ISR? and where is the RXNE interrupt flag being cleared?

         

        The easiest solution might be to add something like

         

        while(USART_RX_not_empty(USART1))

        {

             USART_SendData(USART6, USART_ReceiveData(USART1));

        }

        to your IRQ_Handlers.

        that way, if one call to the IRQHandler is skipped for some reason you'll be able to catch up. but if you're generally too slow getting that data out again, you'll run into trouble like with long transfers anyway - then you'll have to use a ring-buffer large enough to compensate that, put your tx data in there, and fetch a new character from that buffer in a TXE IRQ_handler

         

        I don't know if a USART_RX_not_empty function exists - you might have to check the RXNE Flag (not the RXNE Interrupt flag)

        probably using the USART_GetFlagStatus() function.

         

        Oliver

        • 16. Re: Unable to program BCM20736S on custom board
          BoonT_56

          So have you make any progress?

           

          user_2160001

          • 17. Re: Unable to program BCM20736S on custom board

            Now I'm able to program the chip.

             

            I solved the issue increasing the clock speed of the MCU, so the delay between the commands in tx and rx is lower.

            1 of 1 people found this helpful
            • 18. Re: Unable to program BCM20736S on custom board
              MichaelF_56

              Thanks for reporting your findings back to the thread.

              1 2 Previous Next