UART bandwidth demand

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • UART bandwidth demand

      Hello,

      I'm trying to integrate SystemView into an Aurix TC3xx FreeRTOS port. After a while I'm able to see some data in SystemView. However, I have some UART bandwidth issues.
      As far as i understood the SystemView target code the function _SendPacket() is called each time the SystemView Host needs to update information (more precisly the SEGGER_SYSVIEW_ON_EVENT_RECORDED() call) . Usually such a packet is only a few bytes (defined in SEGGER_SYSVIEW_INFO_SIZE 9). My application is currently very simple and is just blocking/unblocking one task every 250ms. However, the _SendPacket() function is called at a significant higher frequency. I understand that calling it every OS-tick makes sense. But in my case it is really very high. I configured a pin toggle each time the SEGGER_SYSVIEW_ON_EVENT_RECORDED() is called. The screenshot below shows the starting phase. So the first sequence of pulse is each time SEGGER_SYSVIEW_ON_EVENT_RECORDED() is called in the function SEGGER_SYSVIEW_START(). Just those burst is causing 14 times to invoke the SEGGER_SYSVIEW_ON_EVENT_RECORDED() function.
      After that a certain pattern can be observed that seems partly to be repeated (my oszi is not allowing me to do longer traces).


      If I zoom in in the first group it looks like this:

      There are 22 calls of SEGGER_SYSVIEW_ON_EVENT_RECORDED within approx 340usec. So if each of them is asking for 9 Bytes data transmission I end up with (9*(8+2)*22)/340usec=5.8MBit/s. I guess that will be not possible to transmit reliable on a simple RS232 line. I'm already using a queue that contains the number of bytes that needs to be transmitted each time SEGGER_SYSVIEW_ON_EVENT_RECORDED() is called and DMA to transmit these bytes without CPU intervention. The necessary interrupt at the end of each DMA transport takes only 3,1usec. From my experience about powerful ARM microcontrollers this is very competitive.
      Did I miss something? Did I made a mistake on my adoption of the SysView target to the Aurix 3xx? Why do I get such a high frequency for the SEGGER_SYSVIEW_ON_EVENT_RECORDED() call.


      Best Regards
      Markus
      Images
      • Screenshot 2024-04-28 182304.png

        9.51 kB, 1,681×316, viewed 170 times
      • Screenshot 2024-04-28 181017.png

        9.39 kB, 1,671×220, viewed 152 times
    • Small update:
      I moved the upload to the host PC into a low priority task that is consistently checking if there is new content in the upload buffer (instead of adding a queue entry, that I realized is adding further traffic and therefore makes things even worse). I'm still using DMA transfer and moving all available bytes by one DMA transaction. Things improved but are still hard to handle even if I go up to 4.8MBit/s - that I'm surprised that this is even working. My BUFFER_SIZE_UP has reached now 'unhealthy' 20kByte - and is still not enough. I'm able to transfer about 2MByte till the communication target->PC crash.
      The period of calling _SendPacket() drops down to about 80 usec and seems to ask for 36 Bytes each time. So this is 4x SEGGER_SYSVIEW_INFO_SIZE that propably makes sense. However, I'm still confused about that high rate of 80 usec period (that is about 12.5kHz, while my Systick is 1kHz). Anybody having an idea where this comes from?
      I'm using FreeRTOS 10.5 and SysView 3.54 on the target. My next step will be to switch to FreeRTOS 11 (hopefully that is easy to manage in the Aurix port).

      Best Regards
      Markus