cancel
Showing results for 
Search instead for 
Did you mean: 

How to watch an array using STM32CubeMonitor?

xpp07
Senior

How should I configure STM32CubeMonitor to watch the flow of an array? I can either select the first position or expand the array but then the graph will be a mess. See below.

0693W000006FCraQAG.png0693W000006FCrfQAG.png

14 REPLIES 14

Update 2024 If download links are broken, check attachments below this message (*.7z archive). 

Update 2023 (STM32CubeMonitor 1.6.0) Watching multiple 1D arrays + better code:

New version available (cubearrays v1.0)! Now all arrays are automatically parsed and stored in global variables. Step-by-step instructions:

  1. Download cubearrays here: nodes10.zip (use nodes from "cubearrays" directory)
  2. Open STM32CubeMonitor, find three stripes / hamburger in up-right corner and press it to open menu → Import
  3. In "Import nodes" windows select "Local" → STM32CubeMonitor_BasicFlow.json → press Import button
  4. Delete "show notification", "myChart" and "Clear Graphs" nodes
  5. Three stripes / hamurger → Import → Clipboard tab → "select a file to import" button → find and select cubearrays10.json → Import button
  6. Connect variables node upper output to "CubeArrays v1.0" function input node
  7. Double-click "CubeArrays v1.0" function node, select "On Message" tab, scroll down to const arrayNames=["arrayName1","arrayName2",...
  8. Replace "arrayName1", "arrayName2" by actual array names put in quotes (case sensitive!)
  9. Double-click Chart #1, write first array element count in "OR points" field
  10. If you added Chart node by yourself, set "Set X-axis Label" to "custom" and enter "x"
  11. Set Y-axis min and max values according to your requirements. For uint8_t it would be min: 0, max: 255
  12. Configure Chart #2 and Chart 3 in the same manner
  13. Double-click myProbe_Out node, select your STLink probe. If list is empty, press pencil button, select your ST-Link, write some Name, press "Add" button → "Done"
  14. Double-click myProbe_In node, select your ST-Link probe → "Done"
  15. Compile your project, find debug directory with ELF file
  16. Double-click "myVariables" node → Pencil button near "Executable"
  17. Paste ELF file folder path to "Folder" field → Press "File" drop-down list and select your project .elf file
  18. Press "Expand Variable List" → write first array name in lower-right "filter" field and press "Select All" button
  19. Select all elements of second and third array using same approach: write name in filter → press "Select All"
  20. Write some text in "Name" field, this will enable "Add" button
  21. After pressing "Add" button large arrays cause significant delay before STM32CubeMonitor user interface become responsive
  22. Press Deploy button → Dashboard button → in opened window START ACQUISTION button
  23. Correct chart configurations if some graphs are out of scale

Example using cubearray10.json in STM32CubeMonitor v1.6.0:
Three arrays - https://youtu.be/_tnx1ZxkiY8

Old version:

Just tried in latest version (1.2.0), please check this short explanatory video https://youtu.be/VAxnharGr_M

Note that script is written in previous version, probably 1.1.0 and worked without a problem too. It turns out I wrote it in 1.2.0. Some steps of explanatory video:

  1. Top right corner menu button → Import → Library → Stm32CubeMonitor_BasicFlow.json
  2. Deleted previous unused tab "Basic_Flow"
  3. Top right corner menu button → Import → Clipboard → "select a file to import" → sigview2.json
  4. "Some of nodes you are importing already exist in your workspace" → Import copy
  5. Delete "Mychart" and "Clear Graphs" nodes by selecting them using mouse right-click and pressing "Del" on keyboard
  6. Connect "myVariables" node output to newly imported "function" and "switch" nodes as shown on screenshot/in video
  7. Select ST-link in "myProbe_Out" and "myProbe_In" nodes
  8. In upper "myVariables" node press "Add new exe-config..." → select path to *.ELF in your project directory
  9. Set checkbox "expand Variable List" to expand array elements to separate variables
  10. In filter textfield write "testBuffer" (case sensitive)
  11. Press "Select All" button to select all elements of testBuffer[0],testBuffer[1],testBuffer[2],... array
  12. Put some name for executable in "Name" textfield, so "Add" button will become available, press "Add" button
  13. Update 2021: double-click "switch" and change name to mach name in your source code / axf file. If your array is named someArray, then you put here someArray[9]. "9" index is used because of alphabetical sorting it is the last array element during readout for 1024 elements. You can see it in "variables"
  14. Press "DEPLOY" button
  15. Press "DASHBOARD" button → in new window press "START ACQUISTION"
  16. You can see array is displayed correctly as sine graph.

 

Most important steps: select ST_Link, import Stm32CubeMonitor_BasicFlow.json example and combine it with sigview2.json. Add all array elements as separate variables to the list. If array name and size in your code matches testBuffer in Node-RED script, then everything must work after pressing deploy→dashboard→start.

 

Update 2021: watching array with different name/size

Assume we have an array ADC_BUFF1 with values ranging from -1 to +1

float32_t ADC_BUFF1[256]; 
//...
for (int i=0; i<256; i++)
{
	ADC_BUFF1[i]=sin(2.0*M_PI/256*i);
}
 

To make it work

  1. double-click first function
  2. open setup tab
  3. replace 1024 with 256 in for (var i=0;i<256;i++)
  4. double-click "switch"
  5. replace text with ADC_BUFF1[9]
  6. double-click "chart"
  7. replace 1024 with 256, set Y-axis min/max to -1 1

 

0693W00000FCashQAD.jpg 

I see that Setup and Close tabs are missing on your screenshot, I do not know why. Those tabs are common for function nodes in Node-RED, for example:

https://discourse.nodered.org/t/setup-in-a-function-node/39445

 

What happens if you put empty function node and double-click on it? Still no Setup/Close tabs?

Disappointed with crowdfunding projects? Make a lasting, meaningful impact as a Tech Sponsor instead: Visit TechSponsor.io to Start Your Journey!

Hello

The setup tab has been added in Node-RED after the release of STM32CubeMonitor 1.1.0. The feature is included in V1.2.0, you need to upgrade to have it.

It allows to have code execute at init and end of flows execution in the function nodes.

you are right, I thought 1.2.0 is released recently, but it was already available around April 2021. Probably @Community member​ downloaded older version because of interface

0693W00000Dnh9VQAR.jpgAs seen on this image, select version does not include latest version download link.

Disappointed with crowdfunding projects? Make a lasting, meaningful impact as a Tech Sponsor instead: Visit TechSponsor.io to Start Your Journey!
ADunc.1
Senior

Thanks. I had fallen into the trap of selecting V1.1.0 from the drop down. I had wondered where you got V1.2.0 from! I should have opened my eyes...

After updating the setup tab is visible and the warning message is gone. Note that even though there was a warning message it was still working correctly and was super helpful in debugging.

Thanks for taking the time to share your idea and help me.

Richard.Chvr
ST Employee

@Community member​ and @Georgy Moshkin​ , interface have been updated and now shows the latest version in the Select version list.

Thanks' for your feedback.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.