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


sw4stm32 fails to link a cpp header and source file

hi.
i created a project for the stm32l4-discovery board with the system workbench via:
new->cpp project->ac6 executable stm32 mcu project and chose the discovery board.
the workbench already adds both gcc and g++ and has already converted the project
to a c++ project.

now, when i add own classes, i add the path to the header to both compilers
(is this right or just g++?), rename the main.c to main.cpp.
after adding the header of the class to the main file, i try to create a sample
object.

somewhat, the workbench seems to fail linking source and header file of the object.
when i add the source file as include to the main.cpp, it compiles without error.
if i just add the header like normally, the compiler can find only the constructors
prototype in the header but cant see the definition of the constructor in the source file.

what is wrong here?

---------
main.c
---------

  1. include
  2. include // this way it works, without it doesnt


ComPoint Test;

while(1)
{

}

---------
comPoint.hpp
---------
/* Guard symbol ----------------------*/

  1. ifndef COMPOINT_HPP_
  2. define COMPOINT_HPP_


/* Includes ----------------------*/

  1. include “stdint.h”


/* Class definition ----------------------*/
class ComPoint
{
public:
ComPoint(void);
ComPoint(uint8_t initX, uint8_t initY);
~ComPoint(void);

void SetPoint(ComPoint p);
void SetX(uint8_t x);
void SetY(uint8_t y);
uint8_t GetX(void);
uint8_t GetY(void);

private:
uint8_t xCoord;
uint8_t yCoord;
};

  1. endif /* COMPOINT_HPP_ */


---------
comPoint.cpp
---------
/* Includes ----------------------*/

  1. include


/* Object function definitions -------------------*/

// constructor of the object
ComPoint::ComPoint(void)
: xCoord(0), yCoord(0)
{

}

// constructor of the object
ComPoint::ComPoint(uint8_t initX, uint8_t initY)
: xCoord(initX), yCoord(initY)
{

}

// destructor of the object
ComPoint::~ComPoint(void)
{

}

void ComPoint::SetPoint(ComPoint p)
{
xCoord = p.GetX();
yCoord = p.GetY();
}

void ComPoint::SetX(uint8_t x)
{
xCoord = x;
}

void ComPoint::SetY(uint8_t y)
{
yCoord = y;
}

uint8_t ComPoint::GetX(void)
{
return xCoord;
}

uint8_t ComPoint::GetY(void)
{
return yCoord;
}