How to watch an array using STM32CubeMonitor?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-09 10:19 AM
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.
Solved! Go to Solution.
- Labels:
-
STM32CubeMonitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-20 12:43 AM - edited ‎2024-03-05 05:37 PM
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:
- Download cubearrays here: nodes10.zip (use nodes from "cubearrays" directory)
- Open STM32CubeMonitor, find three stripes / hamburger in up-right corner and press it to open menu → Import
- In "Import nodes" windows select "Local" → STM32CubeMonitor_BasicFlow.json → press Import button
- Delete "show notification", "myChart" and "Clear Graphs" nodes
- Three stripes / hamurger → Import → Clipboard tab → "select a file to import" button → find and select cubearrays10.json → Import button
- Connect variables node upper output to "CubeArrays v1.0" function input node
- Double-click "CubeArrays v1.0" function node, select "On Message" tab, scroll down to const arrayNames=["arrayName1","arrayName2",...
- Replace "arrayName1", "arrayName2" by actual array names put in quotes (case sensitive!)
- Double-click Chart #1, write first array element count in "OR points" field
- If you added Chart node by yourself, set "Set X-axis Label" to "custom" and enter "x"
- Set Y-axis min and max values according to your requirements. For uint8_t it would be min: 0, max: 255
- Configure Chart #2 and Chart 3 in the same manner
- 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"
- Double-click myProbe_In node, select your ST-Link probe → "Done"
- Compile your project, find debug directory with ELF file
- Double-click "myVariables" node → Pencil button near "Executable"
- Paste ELF file folder path to "Folder" field → Press "File" drop-down list and select your project .elf file
- Press "Expand Variable List" → write first array name in lower-right "filter" field and press "Select All" button
- Select all elements of second and third array using same approach: write name in filter → press "Select All"
- Write some text in "Name" field, this will enable "Add" button
- After pressing "Add" button large arrays cause significant delay before STM32CubeMonitor user interface become responsive
- Press Deploy button → Dashboard button → in opened window START ACQUISTION button
- 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:
- Top right corner menu button → Import → Library → Stm32CubeMonitor_BasicFlow.json
- Deleted previous unused tab "Basic_Flow"
- Top right corner menu button → Import → Clipboard → "select a file to import" → sigview2.json
- "Some of nodes you are importing already exist in your workspace" → Import copy
- Delete "Mychart" and "Clear Graphs" nodes by selecting them using mouse right-click and pressing "Del" on keyboard
- Connect "myVariables" node output to newly imported "function" and "switch" nodes as shown on screenshot/in video
- Select ST-link in "myProbe_Out" and "myProbe_In" nodes
- In upper "myVariables" node press "Add new exe-config..." → select path to *.ELF in your project directory
- Set checkbox "expand Variable List" to expand array elements to separate variables
- In filter textfield write "testBuffer" (case sensitive)
- Press "Select All" button to select all elements of testBuffer[0],testBuffer[1],testBuffer[2],... array
- Put some name for executable in "Name" textfield, so "Add" button will become available, press "Add" button
- 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"
- Press "DEPLOY" button
- Press "DASHBOARD" button → in new window press "START ACQUISTION"
- 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
- double-click first function
- open setup tab
- replace 1024 with 256 in for (var i=0;i<256;i++)
- double-click "switch"
- replace text with ADC_BUFF1[9]
- double-click "chart"
- replace 1024 with 256, set Y-axis min/max to -1 1
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-20 12:53 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-20 01:12 AM
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
As seen on this image, select version does not include latest version download link.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-09-20 02:08 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-11 02:13 AM
@Community member​ and @Georgy Moshkin​ , interface have been updated and now shows the latest version in the Select version list.
Thanks' for your feedback.

- « Previous
-
- 1
- 2
- Next »