Hi gsinde@psiber.com,
Yes, my CPU is MK22FN512
I have to pay attention to the subject line more, duh. I had the feeling you were talking about the K22 but I didn't see that in the text of your posts.
Thank you for pointing out AN4745.pdf - I haven't seen that before and it offers some interesting information (it's now in my folder of useful ApNotes).
I just deleted a long winded answer to your question:
Do you agree that this LOWER block is faster?
and I realized that it's probably better to simply state the answer as:
I don't care which block is faster.
When somebody is asking about MCU application "speed", I the question to ask what are the requirements with regards to the needed response time for different stimuli. When you are working with an MCU with a UI, sensors, actuators, communications, the "speed of operation" is more appropriately defined as "response time" to different inpputs and the question becomes does the application respond in an appropriately timely manner:
- Does the UI put a message up on the display in a reasonable amount of time after a button is pushed?
- Does the conveyor stop after a jam is detected in time to avoid damaging the hardware?
- Is logging data sent to the host system within the required time to avoid a no response condition?
When doing part selection for an application, I am looking for a device that meets the response time requirements without doing anything special. If a part number is so marginal for the application requirements that I have to worry about the number of clock cycles per block read to meet the requirements, I'm going to look at other devices.
Last point on the heap model. I looked at this some time ago and decided to stick with Heap 4 for FreeRTOS. I think we agree that MCU application code shouldn't have any malloc's/free's in the application code (memory leaks are too much of a danger for an embedded device with no MMU regardless of how good a programmer you are) but that doesn't mean that RTOS resources don't use these functions. When I looked at the FreeRTOS code, the messaging functions (queues, semaphores, mutexes, notifications, etc.) DO use malloc's and free's to handle different message sizes - if you use Heap1 I seem to remember that the code for providing buffers for these functions ends up being more complex and execute longer in Heap1 than Heap4. There maybe cases where if you use a single message size and limit the functions you use that Heap1 will be more efficient than Heap4 but that will reduce your options significantly - you should probably ask this question in the FreeRTOS community forum.
myke