7 Replies Latest reply on Nov 25, 2014 7:32 PM by userc_6396 Branched to a new discussion.

    Anyway to monitor CPU utilization

      Hello,

       

      In our use case, Master needs to support the multiple Slave connection simultaneously

      and receive Notification data from all Slave simultaneously.

       

      I would like to estimate how many Slave the Master can handle.

      I know it supports up to 8 simultaneous connections,

      but my concern is CPU bandwidth with simultaneous heavy traffic from multiple Slave.

      All data received is to be sent over PUART which would also consume a substantial CPU bandwidth.

       

      Is there any way for the application to check CPU utilization?

      Since CPU is to be shared by the application and BLE stack,

      it would be valuable for the application to monitor CPU utilization.

       

      Thanks!!

        • 1. Re: Anyway to monitor CPU utilization
          MichaelF_56

          I don't think this is possible, but I will check around with the developers to see if they have been asked this question in the past.

           

          MiTo_1583836

          VictorZ_46 userc_7012

          • 2. Re: Anyway to monitor CPU utilization

            If you add your on LOG, TRACE or debug hooks, e.g. sending messages via UART to see if MCU is On/Off ... you might get a clue (with timestamps when you receive messages).

            Should be possible with dedicated debug and trace hooks added in the code.

            • 3. Re: Anyway to monitor CPU utilization
              MichaelF_56

              I verified with the developers that there is no way to do this on the BCM2073x because the BLE stack runs threads that are invisible to the developer, making it nearly impossible to insert hooks to measure performance.

              • 4. Re: Anyway to monitor CPU utilization
                MiTo_1583836

                You can use the empirical approach, start with one slave advertising and connecting followed by a second one,..., up to eight. I would also try the same scenario with all the slaves advertising at the same time. I that configuration I would add more than 8 slaves advertising (to create extra noise), maybe 10-15.

                 

                For the PUART I would generate traffic regularly. If the traffic is based on user action I would generate traffic every 500ms to 1s (even fake traffic).

                 

                The application thread that is dedicated to your application processes the event queue (entry point), so you will need to look at that closely, making sure the thread is doing its job on a timely manner.Someone suggested time stamps in your logs, I think it is a good one to add.

                 

                I believe you are using the timer (or maybe both) for your internal application design. I would also try to play with the period of the timer, decreasing it (so the timer callback executes more often).

                1 of 1 people found this helpful
                • 5. Re: Anyway to monitor CPU utilization

                  Thanks for the advices.

                   

                  As for the timestamp, I couldn't find an API to check CPU cycle time.

                  Only thing available seems like fine timer tick which is 12.5 ms resolution.

                  So, I don't think it is useful for any CPU profiling.

                  • 6. Re: Anyway to monitor CPU utilization

                    >> I verified with the developers that there is no way to do this on the BCM2073x

                    >> because the BLE stack runs threads that are invisible to the developer,

                    >> making it nearly impossible to insert hooks to measure performance


                    Just providing hooks just before and after ARM WFI (Wait For Interrupt) in your Idle task

                    would be sufficient for the SDK users to measure CPU utilization.


                    • 7. Re: Anyway to monitor CPU utilization

                      Cortex M3 does not have Performance Counters (as a Cortex A9). If ETM is available in silicon - no clue
                      (but it would need anyway a special debugger).

                       

                      Maybe, you can use the SYSTICK (if not used by RTOS: if so you might use something from RTOS or the SYSTICK counter itself just by reading).

                       

                      Or you drive a GPIO pin and measure with scope from outside.

                       

                      embedded - Cycle counter on ARM Cortex M4 (or M3)? - Stack Overflow