... | @@ -81,3 +81,39 @@ For the *f407vg* board, there's also another serial port, called **auxtty**: you |
... | @@ -81,3 +81,39 @@ For the *f407vg* board, there's also another serial port, called **auxtty**: you |
|
const unsigned int auxSerialSpeed=9600;
|
|
const unsigned int auxSerialSpeed=9600;
|
|
const bool auxSerialFlowctrl=false;
|
|
const bool auxSerialFlowctrl=false;
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### Example
|
|
|
|
Usage of *TRACE()* in order to send data to the PC.
|
|
|
|
|
|
|
|
##### test-serial.cpp
|
|
|
|
```cpp
|
|
|
|
#include <Common.h>
|
|
|
|
|
|
|
|
using namespace miosix;
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
TRACE("%d : Serial is working!\n", i);
|
|
|
|
Thread::sleep(1000);
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
##### sbs.conf
|
|
|
|
You should also add the following configuration to `sbs.conf`.
|
|
|
|
```config
|
|
|
|
[test-serial]
|
|
|
|
Type: test
|
|
|
|
BoardId: *your-board-id* # e.g. stm32f407vg_stm32f4discovery
|
|
|
|
BinName: test-serial
|
|
|
|
Include: %shared
|
|
|
|
Defines: -DDEBUG
|
|
|
|
Main: test-serial
|
|
|
|
```
|
|
|
|
The *-DDEBUG* define is necessary in order for the *TRACE()* macro to act as a normal *printf()*.
|
|
|
|
Moreover the *shared* include is needed in order to compile also `Debug.cpp`, on which the *TRACE()* macro depends. |
|
|
|
\ No newline at end of file |