Skip to content

Commit 2b91463

Browse files
committed
Add documentation for STM32 system_info/1 keys
Adds documentation to the `erlang` module and "Programmer's Guide" for newly added STM32 system_info/1 keys. Signed-off-by: Winford <winford@object.stream>
1 parent 9f61884 commit 2b91463

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

doc/src/programmers-guide.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,11 @@ For example,
624624
io:format("Atom Count: ~p~n", [erlang:system_info(atom_count)]).
625625
```
626626

627+
In addition AtomVM supports the following keys on ESP32 and STM32 platforms:
628+
629+
* `atomvm_free_heap_size` Returns the available free space in the heap.
630+
* `atomvm_minimum_free_size` Returns the smallest ever free space available in the heap since boot, this will tell you how close you have come to running out of free memory.
631+
627632
```{note}
628633
Additional platform-specific information is supported, depending on the platform type. See below.
629634
```
@@ -1141,9 +1146,7 @@ As noted above, the [`erlang:system_info/1`](./apidocs/erlang/estdlib/erlang.md#
11411146
11421147
You can request ESP32-specific information using using the following input atoms:
11431148
1144-
* `esp32_free_heap_size` Returns the available free space in the ESP32 heap.
11451149
* `esp32_largest_free_block` Returns the size of the largest free continuous block in the ESP32 heap.
1146-
* `esp32_minimum_free_size` Returns the smallest ever free space available in the ESP32 heap since boot, this will tell you how close you have come to running out of free memory.
11471150
* `esp32_chip_info` Returns map of the form `#{features := Features, cores := Cores, revision := Revision, model := Model}`, where `Features` is a list of features enabled in the chip, from among the following atoms: `[emb_flash, bgn, ble, bt]`; `Cores` is the number of CPU cores on the chip; `Revision` is the chip version; and `Model` is one of the following atoms: `esp32`, `esp32_s2`, `esp32_s3`, `esp32_c3`, etc.
11481151
* `esp_idf_version` Return the IDF SDK version, as a string.
11491152
@@ -1591,7 +1594,7 @@ The read options take the form of a proplist, if the key `raw` is true (`{raw, t
15911594
15921595
If the key `voltage` is true (or simply appears in the list as an atom), then a calibrated voltage value will be returned in millivolts in the second element of the returned tuple. Otherwise, this element will be the atom `undefined`.
15931596
1594-
You may specify the number of samples (1 - 100000) to be taken and averaged over using the tuple `{samples, Samples :: 1..100000}`, the default is `64`.
1597+
You may specify the number of samples (1 - 100000) to be taken and averaged over using the tuple `{samples, Samples :: 1..100000}`, the default is `64`.
15951598
15961599
```{warning}
15971600
Using a large number of samples can significantly increase the amount of time before a response, up to several seconds.

libs/estdlib/src/erlang.erl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,15 @@ process_info(_Pid, _Key) ->
289289
%% <li><b>schedulers</b> the number of schedulers, equal to the number of online processors (integer)</li>
290290
%% <li><b>schedulers_online</b> the current number of schedulers (integer)</li>
291291
%% </ul>
292+
%% The following keys are supported on ESP32 and STM32 platforms:
293+
%% <ul>
294+
%% <li><b>atomvm_free_heap_size</b> the number of (noncontiguous) free bytes in the STM32 heap (integer)</li>
295+
%% <li><b>atomvm_minimum_free_size</b> the smallest number of free bytes in the STM32 heap since boot (integer)</li>
296+
%% </ul>
297+
%%
292298
%% The following keys are supported on the ESP32 platform:
293299
%% <ul>
294-
%% <li><b>esp32_free_heap_size</b> the number of (noncontiguous) free bytes in the ESP32 heap (integer)</li>
295300
%% <li><b>esp32_largest_free_block</b> the number of the largest contiguous free bytes in the ESP32 heap (integer)</li>
296-
%% <li><b>esp32_minimum_free_size</b> the smallest number of free bytes in the ESP32 heap since boot (integer)</li>
297301
%% <li><b>esp32_chip_info</b> Details about the model and capabilities of the ESP32 device (map)</li>
298302
%% </ul>
299303
%%

0 commit comments

Comments
 (0)