Skip to content
Permalink
Browse files

goil compiled with last galgas version

  • Loading branch information
jlbirccyn committed Dec 13, 2019
2 parents 53f013a + aa2cfef commit aa60a7b4b5d2084f450ab415a01b552ae6556433
Showing with 1,065 additions and 152 deletions.
  1. BIN documentation/manual/msp430/porting.pdf
  2. +9 −7 documentation/manual/msp430/porting.tex
  3. +7 −0 examples/msp430x/small/msp430fr5969/launchpad/basicCPP/.gitignore
  4. +11 −0 examples/msp430x/small/msp430fr5969/launchpad/basicCPP/README.md
  5. +52 −0 examples/msp430x/small/msp430fr5969/launchpad/basicCPP/basicCPP.cpp
  6. +78 −0 examples/msp430x/small/msp430fr5969/launchpad/basicCPP/basicCPP.oil
  7. +15 −2 examples/msp430x/small/msp430fr5969/launchpad/serial/README.md
  8. +17 −3 examples/msp430x/small/msp430fr5969/launchpad/serial/serial.c
  9. +12 −5 examples/msp430x/small/msp430fr5969/launchpad/serial/serial.oil
  10. +7 −0 examples/msp430x/small/msp430fr5994/launchpad/basicCPP/.gitignore
  11. +11 −0 examples/msp430x/small/msp430fr5994/launchpad/basicCPP/README.md
  12. +52 −0 examples/msp430x/small/msp430fr5994/launchpad/basicCPP/basicCPP.cpp
  13. +78 −0 examples/msp430x/small/msp430fr5994/launchpad/basicCPP/basicCPP.oil
  14. +7 −0 examples/msp430x/small/msp430fr5994/launchpad/serial/.gitignore
  15. +24 −0 examples/msp430x/small/msp430fr5994/launchpad/serial/README.md
  16. +3 −0 examples/msp430x/small/msp430fr5994/launchpad/serial/init.gdb
  17. +55 −0 examples/msp430x/small/msp430fr5994/launchpad/serial/serial.c
  18. +83 −0 examples/msp430x/small/msp430fr5994/launchpad/serial/serial.oil
  19. +1 −0 examples/posix/periodic/periodic.oil
  20. 0 goil/build/libpm/all-libpm.cpp
  21. 0 goil/build/libpm/bdd/C_BDD-and-operation.cpp
  22. 0 goil/build/libpm/bdd/C_BDD-find-or-add.cpp
  23. 0 goil/build/libpm/bdd/C_BDD-node.h
  24. 0 goil/build/libpm/bdd/C_BDD-single-operand-ops.cpp
  25. 0 goil/build/libpm/bdd/C_BDD.cpp
  26. 0 goil/build/libpm/bdd/C_BDD.h
  27. 0 goil/build/libpm/cache/TC_prime_cache2.h
  28. 0 goil/build/libpm/cocoa_galgas/CocoaGalgasPrefix.h
  29. 0 goil/build/libpm/cocoa_galgas/F_CocoaWrapperForGalgas.h
  30. BIN goil/build/libpm/cocoa_galgas/I_Stop.tiff
  31. 0 goil/build/libpm/cocoa_galgas/OC_GGS_ApplicationDelegate.h
  32. 0 goil/build/libpm/cocoa_galgas/OC_GGS_ApplicationDelegate.m
  33. 0 goil/build/libpm/cocoa_galgas/OC_GGS_Document.h
  34. 0 goil/build/libpm/cocoa_galgas/OC_GGS_Document.m
  35. 0 goil/build/libpm/cocoa_galgas/OC_GGS_RulerViewForTextView.h
  36. 0 goil/build/libpm/cocoa_galgas/OC_GGS_RulerViewForTextView.m
  37. 0 goil/build/libpm/cocoa_utilities/main.m
  38. 0 goil/build/libpm/collections/TC_Array.h
  39. 0 goil/build/libpm/collections/TC_Array2.h
  40. 0 goil/build/libpm/collections/TC_FIFO.h
  41. 0 goil/build/libpm/collections/TC_LinkedList.h
  42. 0 goil/build/libpm/collections/TC_UniqueArray.h
  43. 0 goil/build/libpm/collections/TC_UniqueArray2.h
  44. 0 goil/build/libpm/collections/TC_UniqueSparseArray.h
  45. 0 goil/build/libpm/command_line_interface/F_Analyze_CLI_Options.cpp
  46. 0 goil/build/libpm/command_line_interface/F_Analyze_CLI_Options.h
  47. 0 goil/build/libpm/command_line_interface/F_mainForLIBPM.cpp
  48. 0 goil/build/libpm/command_line_interface/F_mainForLIBPM.h
  49. 0 goil/build/libpm/files/C_BinaryFileWrite.cpp
  50. 0 goil/build/libpm/files/C_BinaryFileWrite.h
  51. 0 goil/build/libpm/files/C_HTML_FileWrite.cpp
  52. 0 goil/build/libpm/files/C_HTML_FileWrite.h
  53. 0 goil/build/libpm/files/C_TextFileWrite.cpp
  54. 0 goil/build/libpm/files/C_TextFileWrite.h
  55. 0 goil/build/libpm/galgas2/AC_GALGAS_sortedlist.cpp
  56. 0 goil/build/libpm/galgas2/C_Compiler.cpp
  57. 0 goil/build/libpm/galgas2/C_Compiler.h
  58. 0 goil/build/libpm/galgas2/C_Lexique.cpp
  59. 0 goil/build/libpm/galgas2/C_Lexique.h
  60. 0 goil/build/libpm/galgas2/C_LocationInSource.cpp
  61. 0 goil/build/libpm/galgas2/C_LocationInSource.h
  62. 0 goil/build/libpm/galgas2/C_SourceTextInString.cpp
  63. 0 goil/build/libpm/galgas2/C_SourceTextInString.h
  64. 0 goil/build/libpm/galgas2/C_galgas_class_inspector.cpp
  65. 0 goil/build/libpm/galgas2/C_galgas_class_inspector.h
  66. 0 goil/build/libpm/galgas2/C_galgas_function_descriptor.cpp
  67. 0 goil/build/libpm/galgas2/C_galgas_function_descriptor.h
  68. 0 goil/build/libpm/galgas2/C_galgas_io.cpp
  69. 0 goil/build/libpm/galgas2/C_galgas_io.h
  70. 0 goil/build/libpm/galgas2/C_galgas_type_descriptor.cpp
  71. 0 goil/build/libpm/galgas2/C_galgas_type_descriptor.h
  72. 0 goil/build/libpm/galgas2/GALGAS_application.cpp
  73. 0 goil/build/libpm/galgas2/GALGAS_bigint.cpp
  74. 0 goil/build/libpm/galgas2/GALGAS_bool.cpp
  75. 0 goil/build/libpm/galgas2/GALGAS_char.cpp
  76. 0 goil/build/libpm/galgas2/GALGAS_data.cpp
  77. 0 goil/build/libpm/galgas2/GALGAS_double.cpp
  78. 0 goil/build/libpm/galgas2/GALGAS_function.cpp
  79. 0 goil/build/libpm/galgas2/GALGAS_location.cpp
  80. 0 goil/build/libpm/galgas2/GALGAS_sint.cpp
  81. 0 goil/build/libpm/galgas2/GALGAS_sint_36__34_.cpp
  82. 0 goil/build/libpm/galgas2/GALGAS_string.cpp
  83. 0 goil/build/libpm/galgas2/GALGAS_stringset.cpp
  84. 0 goil/build/libpm/galgas2/GALGAS_timer.cpp
  85. 0 goil/build/libpm/galgas2/GALGAS_type.cpp
  86. 0 goil/build/libpm/galgas2/GALGAS_uint.cpp
  87. 0 goil/build/libpm/galgas2/GALGAS_uint_36__34_.cpp
  88. 0 goil/build/libpm/galgas2/cEnumerator_range.cpp
  89. 0 goil/build/libpm/galgas2/cEnumerator_range.h
  90. 0 goil/build/libpm/galgas2/cIndexingDictionary.cpp
  91. 0 goil/build/libpm/galgas2/cIndexingDictionary.h
  92. 0 goil/build/libpm/galgas2/cIssueDescriptor.cpp
  93. 0 goil/build/libpm/galgas2/cIssueDescriptor.h
  94. 0 goil/build/libpm/galgas2/cProductionNameDescriptor.h
  95. 0 goil/build/libpm/galgas2/cTemplateDelimiter.h
  96. 0 goil/build/libpm/galgas2/scanner_actions.cpp
  97. 0 goil/build/libpm/galgas2/scanner_actions.h
  98. 0 goil/build/libpm/python-makefiles/default_build_options.py
  99. 0 goil/build/libpm/streams/AC_OutputStream.cpp
  100. 0 goil/build/libpm/streams/AC_OutputStream.h
  101. 0 goil/build/libpm/streams/C_ConsoleOut.cpp
  102. 0 goil/build/libpm/streams/C_ConsoleOut.h
  103. 0 goil/build/libpm/streams/C_ErrorOut.cpp
  104. 0 goil/build/libpm/streams/C_ErrorOut.h
  105. 0 goil/build/libpm/streams/C_TCPSocketOut.cpp
  106. 0 goil/build/libpm/streams/C_TCPSocketOut.h
  107. 0 goil/build/libpm/time/C_DateTime.cpp
  108. 0 goil/build/libpm/time/C_DateTime.h
  109. 0 goil/build/libpm/time/C_Timer.cpp
  110. 0 goil/build/libpm/time/C_Timer.h
  111. 0 goil/build/libpm/utilities/C_BigInt.cpp
  112. 0 goil/build/libpm/utilities/C_BigInt.h
  113. 0 goil/build/libpm/utilities/C_CRC32.cpp
  114. 0 goil/build/libpm/utilities/C_CRC32.h
  115. 0 goil/build/libpm/utilities/C_PrologueEpilogue.cpp
  116. 0 goil/build/libpm/utilities/C_PrologueEpilogue.h
  117. 0 goil/build/libpm/utilities/F_DisplayException.cpp
  118. 0 goil/build/libpm/utilities/F_DisplayException.h
  119. 0 goil/build/libpm/utilities/F_GetPrime.cpp
  120. 0 goil/build/libpm/utilities/F_GetPrime.h
  121. 0 goil/build/libpm/utilities/MF_Assert.cpp
  122. 0 goil/build/libpm/utilities/MF_Assert.h
  123. 0 goil/build/libpm/utilities/MF_MemoryControl.cpp
  124. +29 −29 goil/build/libpm/utilities/MF_MemoryControl.h
  125. 0 goil/build/libpm/utilities/M_SourceLocation.h
  126. 0 goil/build/libpm/utilities/M_machine.h
  127. 0 goil/build/libpm/utilities/PMUInt128.cpp
  128. 0 goil/build/libpm/utilities/PMUInt128.h
  129. 0 goil/build/libpm/utilities/TF_Swap.h
  130. 0 goil/build/libpm/utilities/basic-allocation.cpp
  131. 0 goil/build/libpm/utilities/basic-allocation.h
  132. 0 goil/build/libpm/utilities/cpp-allocation.cpp
  133. 0 goil/build/libpm/utilities/cpp-allocation.h
  134. 0 goil/build/libpm/utilities/switch-fallthrough.h
  135. +19 −0 goil/templates/code/msp430x/small/msp430fr5994/launchpad/tpl_library_defines.goilTemplate
  136. +1 −1 goil/templates/config/msp430x/small/msp430fr5969/config.oil
  137. +4 −1 goil/templates/config/msp430x/small/msp430fr5969/interruptSources.oil
  138. +25 −0 goil/templates/config/msp430x/small/msp430fr5994/launchpad/config.oil
  139. +18 −32 goil/templates/linker/gnu_ld/msp430x/small/msp430fr5969/script.goilTemplate
  140. +18 −32 goil/templates/linker/gnu_ld/msp430x/small/msp430fr5994/script.goilTemplate
  141. +14 −5 machines/msp430x/small/msp430fr5969/launchpad/serial/README.md
  142. +26 −15 machines/msp430x/small/msp430fr5969/launchpad/serial/serial.c
  143. +4 −1 machines/msp430x/small/msp430fr5969/launchpad/serial/serial.h
  144. +1 −1 machines/msp430x/small/msp430fr5969/launchpad/serial/serial.py
  145. +21 −0 machines/msp430x/small/msp430fr5994/launchpad/serial/README.md
  146. +238 −0 machines/msp430x/small/msp430fr5994/launchpad/serial/serial.c
  147. +36 −0 machines/msp430x/small/msp430fr5994/launchpad/serial/serial.h
  148. +81 −0 machines/msp430x/small/msp430fr5994/launchpad/serial/serial.py
  149. +8 −18 machines/msp430x/small/tpl_startup.c
Binary file not shown.
@@ -1108,21 +1108,23 @@ \section{Memory mapping and memory protection}

\section{Libraries}
\subsection{Serial line}
The launchpad kits use a serial line over USB that can be used for debugging purpose. The configuration is 115200 bauds, 8N1.
The launchpad kits use a serial line over USB that can be used for debugging purpose. The configuration is \emph{9600 bauds, 8N1}. The clock is the DCO, which is not precise enough to get a correct 115200 bauds communication.

The library should be declared in the .oil file (so that dedicated files are included in the build process)
The library should be declared in the .oil file (so that dedicated files are included in the build process), with 2 parameters:
\begin{lstlisting}
BUILD = TRUE {
LIBRARY = serial;
BUILD = TRUE {
LIBRARY = serial {
TXBUFFER = 16;
RXBUFFER = 16;
};
};
\end{lstlisting}

The library is quite limited at this date, and it can only send characters (no reception). There is no ring buffer, and there is a waiting loop if the previous character is not yet sent.

An example is given for the msp430fr5969 launchpad.
The buffers are ring buffers that are updated in the corresponding RX or TX interrupts. If the buffer size is set to 0, the corresponding interrupt is not enabled.

The library supports various MCU change frequencies, and the output frequency is updated (the current message may be corrupted!).

An example is given for the msp430fr5969 launchpad.
\bibliographystyle{plain}
\bibliography{porting}

@@ -0,0 +1,7 @@
basicCPP
build
*_exe
*.bin
*.map
build.py
make.py
@@ -0,0 +1,11 @@
# Basic example using C++

This application is a simple example in C++.
It simply defines a class and 2 global objects.
The prupose is to check that the objects constructors are correctly called before the main in the startup code so that their value is correctly initialized.

The SystemCounter is at 1ms. The serial configuration is 9600, 8N1, with the serial line connected to the debugger (/dev/ttyACM1 on Linux).

`
goil --target=msp430x/small/msp430fr5969/launchpad --templates=../../../../../../goil/templates/ basicCPP.oil
`
@@ -0,0 +1,52 @@
#include "tpl_os.h"
#include "msp430.h"
#include <stdint.h>
#include "tpl_clocks.h"

#define APP_Task_serial_TX_START_SEC_CODE
#include "tpl_memmap.h"

/* The purpose of this class is to test that the constructor
* of the instances are set properly
* during the startup phase, bafore the main.
* */
class basic {
uint32_t mVal;
public:
basic(uint32_t val) { mVal = val;};
uint32_t getVal() {return mVal;};
void incVal() {mVal++;};
};

basic b1(1000);
basic b2(2000);

FUNC(int, OS_APPL_CODE) main(void)
{
// Disable the GPIO power-on default high-impedance mode
// to activate previously configured port settings
PM5CTL0 &= ~LOCKLPM5;
//set GPIO P1.0 (LED2) as an output
P1DIR = 0x01;
tpl_serial_begin();
StartOS(OSDEFAULTAPPMODE);
return 0;
}

TASK(serial_TX)
{
tpl_serial_print_string("Object b1->val :");
tpl_serial_print_int(b1.getVal(),0);
tpl_serial_print_string("\r\n");

tpl_serial_print_string("Object b2->val :");
tpl_serial_print_int(b2.getVal(),0);
tpl_serial_print_string("\r\n");

b1.incVal();
b2.incVal();
TerminateTask();
}

#define APP_Task_serial_TX_STOP_SEC_CODE
#include "tpl_memmap.h"
@@ -0,0 +1,78 @@
OIL_VERSION = "2.5";

IMPLEMENTATION trampoline {
/* This fix the default STACKSIZE of tasks */
TASK {
UINT32 STACKSIZE = 100 ;
} ;

/* This fix the default STACKSIZE of ISRs */
ISR {
UINT32 STACKSIZE = 100 ;
} ;
};

CPU basicCPP {
OS config {
STATUS = EXTENDED;
PAINT_STACK = TRUE;
PAINT_REGISTERS = TRUE;
CPU_FREQ_MHZ = 24;
IDLE_POWER_MODE = LPM3;

BUILD = TRUE {
TRAMPOLINE_BASE_PATH = "../../../../../..";
APP_CPPSRC = "basicCPP.cpp";
APP_NAME = "basicCPP_exe";
CFLAGS = "-O0 -g3 -gdwarf-2 -ggdb"; //gdb usage
LDFLAGS = "-Map=basicCPP.map";
LIBRARY = serial {
TXBUFFER = 16;
RXBUFFER = 16;
};
//use either msp-gcc (provided with Energia)..
CPPCOMPILER = "msp430-g++";
COMPILER = "msp430-gcc";
ASSEMBLER = "msp430-gcc";
LINKER = "msp430-ld";
COPIER = "msp430-objcopy";
//or GCC for MSP (provided by TI)
//CPPCOMPILER = "msp430-elf-g++";
//COMPILER = "msp430-elf-gcc";
//ASSEMBLER = "msp430-elf-gcc";
//LINKER = "msp430-elf-ld";
//COPIER = "msp430-elf-objcopy";
//CFLAGS = "-I/opt/ti/ccs920/ccs/ccs_base/msp430/include_gcc";
SYSTEM = PYTHON;
};
SYSTEM_CALL = TRUE;
MEMMAP = TRUE {
COMPILER = gcc;
LINKER = gnu_ld { SCRIPT = "script.ld"; };
ASSEMBLER = gnu_as;
MEMORY_PROTECTION = FALSE;
};
};

APPMODE Std {}; // Warning: std will make a problem iwth the namespace std!

TASK serial_TX {
PRIORITY = 2;
AUTOSTART = TRUE {APPMODE = Std;};
ACTIVATION = 1;
SCHEDULE = FULL;
};

ALARM ALSerial_TX {
COUNTER = SystemCounter;
ACTION = ACTIVATETASK {
TASK = serial_TX;
};
AUTOSTART = TRUE {
APPMODE = Std;
ALARMTIME = 1000;
CYCLETIME = 1000;
};
};
};

@@ -1,10 +1,23 @@
# Blink example

This application is a simple periodic example
This application is a simple example using the serial communication over the USB

The SystemCounter is at 1ms.

The task "blink" prints "hello world" to the serial line 115200, 8N1 of the launchpad, that is connected to the USB (through the embbeded debugger).
The serial library should be declared in the .oil file, with the size (in bytes) of the 2 buffers (TX and RX). If any buffers is set to 0, no buffer is used and the related interrupt is not enabled.

```
LIBRARY = serial {
TXBUFFER = 16;
RXBUFFER = 16;
};
```

There are 2 tasks:
* serial_TX is autostart (and run once) and just send a text string on startup.
* serial_RX is periodic (200ms) and check if there are some bytes availables on the rx buffer. The bytes are written back to the serial line if the buffer has more than 10 bytes.

The serial configuration is 9600, 8N1, with the serial line connected to the debugger (/dev/ttyACM1 on Linux).

`
goil --target=msp430x/small/msp430fr5969/launchpad --templates=../../../../../../goil/templates/ serial.oil
@@ -3,7 +3,7 @@
#include <stdint.h>
#include "tpl_clocks.h"

#define APP_Task_serial_START_SEC_CODE
#define APP_Task_serial_TX_START_SEC_CODE
#include "tpl_memmap.h"

FUNC(int, OS_APPL_CODE) main(void)
@@ -18,7 +18,19 @@ FUNC(int, OS_APPL_CODE) main(void)
return 0;
}

TASK(serial)
TASK(serial_TX)
{
tpl_serial_print_string("Test using the serial communication over USB\r\n");
TerminateTask();
}

#define APP_Task_serial_TX_STOP_SEC_CODE
#include "tpl_memmap.h"

#define APP_Task_serial_RX_START_SEC_CODE
#include "tpl_memmap.h"

TASK(serial_RX)
{
static uint16_t size = 0;
if(size != tpl_serial_available())
@@ -30,12 +42,14 @@ TASK(serial)

if(size >= 10)
{
tpl_serial_print_string("=> ");
while(tpl_serial_available())
tpl_serial_putchar(tpl_serial_read());
tpl_serial_print_string("\r\n");
}
}
TerminateTask();
}

#define APP_Task_serial_STOP_SEC_CODE
#define APP_Task_serial_RX_STOP_SEC_CODE
#include "tpl_memmap.h"
@@ -27,7 +27,7 @@ CPU serial {
CFLAGS = "-O0 -g3 -gdwarf-2 -ggdb"; //gdb usage
LDFLAGS = "-Map=serial.map";
LIBRARY = serial {
TXBUFFER = 0;
TXBUFFER = 16;
RXBUFFER = 16;
};
//use either msp-gcc (provided with Energia)..
@@ -54,17 +54,24 @@ CPU serial {

APPMODE std {};

TASK serial {
PRIORITY = 3;
TASK serial_TX {
PRIORITY = 2;
AUTOSTART = TRUE {APPMODE = std;};
ACTIVATION = 1;
SCHEDULE = FULL;
};

TASK serial_RX {
PRIORITY = 4;
AUTOSTART = FALSE;
ACTIVATION = 1;
SCHEDULE = FULL;
};

ALARM serial_serial {
ALARM ALSerial_RX {
COUNTER = SystemCounter;
ACTION = ACTIVATETASK {
TASK = serial;
TASK = serial_RX;
};
AUTOSTART = TRUE {
APPMODE = std;
@@ -0,0 +1,7 @@
basicCPP
build
*_exe
*.bin
*.map
build.py
make.py
@@ -0,0 +1,11 @@
# Basic example using C++

This application is a simple example in C++.
It simply defines a class and 2 global objects.
The prupose is to check that the objects constructors are correctly called before the main in the startup code so that their value is correctly initialized.

The SystemCounter is at 1ms. The serial configuration is 9600, 8N1, with the serial line connected to the debugger (/dev/ttyACM1 on Linux).

`
goil --target=msp430x/small/msp430fr5994/launchpad --templates=../../../../../../goil/templates/ basicCPP.oil
`
@@ -0,0 +1,52 @@
#include "tpl_os.h"
#include "msp430.h"
#include <stdint.h>
#include "tpl_clocks.h"

#define APP_Task_serial_TX_START_SEC_CODE
#include "tpl_memmap.h"

/* The purpose of this class is to test that the constructor
* of the instances are set properly
* during the startup phase, bafore the main.
* */
class basic {
uint32_t mVal;
public:
basic(uint32_t val) { mVal = val;};
uint32_t getVal() {return mVal;};
void incVal() {mVal++;};
};

basic b1(1000);
basic b2(2000);

FUNC(int, OS_APPL_CODE) main(void)
{
// Disable the GPIO power-on default high-impedance mode
// to activate previously configured port settings
PM5CTL0 &= ~LOCKLPM5;
//set GPIO P1.0 (LED2) as an output
P1DIR = 0x01;
tpl_serial_begin();
StartOS(OSDEFAULTAPPMODE);
return 0;
}

TASK(serial_TX)
{
tpl_serial_print_string("Object b1->val :");
tpl_serial_print_int(b1.getVal(),0);
tpl_serial_print_string("\r\n");

tpl_serial_print_string("Object b2->val :");
tpl_serial_print_int(b2.getVal(),0);
tpl_serial_print_string("\r\n");

b1.incVal();
b2.incVal();
TerminateTask();
}

#define APP_Task_serial_TX_STOP_SEC_CODE
#include "tpl_memmap.h"

0 comments on commit aa60a7b

Please sign in to comment.
You can’t perform that action at this time.