Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


How do I compile a .h file?

I am using the fp-net-blestar1 (https://www.st.com/en/embedded-software/fp-net-blestar1.html) in order to make a bluetooth low energy web between a master board, 7 slave SensorTiles (STEVAL-STLCS02V1) and WiFi connectivity to the IBM Watson cloud. Currently the example code only allows these tiles to send environmental data but having read through it, it appears the functionality for sending all sensor data, acceleration, orientation etc, is in the code.

To enable this it looks like you have to change a single line of code in the main.h folder:

/*
* Enable/Disable the possibility to receive MEMS (AGM and SFUSION) notifications
* (1 = MEMS Enabled, 0 = MEMS Disabled)
* WARNING: To be used with ST SensNet V>2.0 application
*/
“HASHTAG”define ENABLE_MEMS 0

I have changed the 0 to a 1 but when I rebuild the project, main.h isn’t being compiled so nothing is actually changing and the sensor tiles are still only sending environmental data.

How to I get SW4STM32 to compile this altered header file? Or is there a work around I can use in order to get these tiles to send all their data over and not just environmental?

France

Hi,

You can’t compile a .h file; to have an effect it must be included in a ‘.c’ file that uses the definitions in this file. I suggest you search in your project for the ENABLE_MEMS symbol (uses the “File Search” feature of System Workbench for STM32 2018 08 06 192822 ) and verifies that “main.h” is included by the corresponding files, then recompile your project.

Bernard (Ac6)


Thank you for the response.

I have checked and main.h is included in multiple locations. Maininclude1 Maininclude2

I have also done what you suggested and searched for the ENABLE_MEMS symbol and I have found all instances of it. Even after I’ve rebuilt he program the macro is still showing it as a 0. ENABLE MEMS Macro

This is really frustrating as I have looked through the code and I can see (or at least believe) that the functionality to send Acc, Gyr and Mag data is there but I don’t understand enough about this code in order to get it to work and send all sensor data over.

France

Hi,

Have you checked that it’s your main.h file that is included; it may happen that there are several files of the same name in different directoies and that a given include get the wrong one... To test you may search for files named “main.h” and/or put a syntax error in your file and check that you get the error message.

If you really get the main.h where you define the symbol as 1 and the code that depends on it is not compiled, that may mean that it is redefined as 0 somewhere else and setting it on the command line will probably not help.

Bernard (Ac6)

France

Hi again,

BTW the fact that Eclipse shows the macro expanding as 0 (which is seen also as the code itself is grayed out) may be an artifact due to indexing problems. To check you may rebuild th eindex, or go in th efile where the #if shows the value as 0 and

  1. add a syntax error in the conditionnaly compiled zone to check if it is compiled or not
  2. search which “main.h” file Eclipse think you are including by double clicking on “main.h” in the file outline (right column in your workspace): this will open the main.h file and you can check if your macro is defined as 1 or 0 (you can get the full pathname by hovering on the editor tab title).


Hope this helps

Bernard (Ac6)


you could always try adding it to your compiler preprocessor defines?
eg: on gcc that would look like -DENABLE_MEMS

so right click on your project, go to “C/C++ Build”. “Settings”, “MCU GCC Compiler”, “Preprocessor”

that’s a pretty blunt instrument but at least you’ll be able to start doing something


To force the compiler to re-include the changes in a header file, you must include that file in a .c file and change something in the .c file (add a space than delete it) so that the compiler would re-build the .c file that includes your .h file. Hope this helps. — BM