Qt » sthello.diff
.gitmodules | ||
---|---|---|
1 | 1 |
[submodule "libarena"] |
2 | 2 |
path = libarena |
3 |
url = git@git.seesslen.net:src/libarena
|
|
3 |
url = ../libarena
|
|
4 | 4 |
[submodule "libbiwak"] |
5 | 5 |
path = libbiwak |
6 |
url = git@git.seesslen.net:src/libbiwak
|
|
6 |
url = ../libbiwak
|
|
7 | 7 |
[submodule "libcampo"] |
8 | 8 |
path = libcampo |
9 |
url = git@git.seesslen.net:src/libcampo
|
|
9 |
url = ../libcampo
|
|
10 | 10 |
[submodule "liblepto"] |
11 | 11 |
path = liblepto |
12 |
url = git@git.seesslen.net:src/liblepto
|
|
12 |
url = ../liblepto
|
|
13 | 13 |
[submodule "libHALWrapper"] |
14 | 14 |
path = libHALWrapper |
15 |
url = git@git.seesslen.net:src/libHALWrapper
|
|
15 |
url = ../libHALWrapper
|
|
16 | 16 |
[submodule "libfosh"] |
17 | 17 |
path = libfosh |
18 |
url = git@git.seesslen.net:src/libfosh |
|
18 |
url = ../libfosh |
CMakeLists.txt | ||
---|---|---|
40 | 40 |
endif( ) |
41 | 41 | |
42 | 42 |
if( NOT HOST ) |
43 | ||
44 |
if ( NOT ARENA_BOARD ) |
|
45 |
# Does not work at the moment |
|
46 |
# set ( ARENA_BOARD "st_discovery_f072" ) |
|
47 |
# set ( ARENA_BOARD "st_discovery_f407" ) |
|
48 |
#------------------------------------ |
|
49 | ||
50 |
# set ( ARENA_BOARD "st_nucleo_f303" ) |
|
51 |
set ( ARENA_BOARD "stm32l011f4" ) |
|
52 |
# set ( ARENA_BOARD "stm32l151c6" ) |
|
53 |
# set ( ARENA_BOARD "stm32l152c8" ) |
|
54 |
# set ( ARENA_BOARD "stm32l152r6" ) |
|
55 |
# set ( ARENA_BOARD "stm32l431rc" ) |
|
56 |
# set ( ARENA_BOARD "stm32f303" ) |
|
57 |
# set ( ARENA_BOARD "stm32f103c6" ) |
|
58 |
# set ( ARENA_BOARD "stm32l443cc" ) |
|
59 |
# set ( ARENA_BOARD "stm32l031f6" ) |
|
60 |
# set ( ARENA_BOARD "stm32f042f6" ) |
|
61 |
# set ( ARENA_BOARD "stm32f042g4" ) |
|
62 |
# set ( ARENA_BOARD "stm32f042g6" ) |
|
63 |
# set ( ARENA_BOARD "stm32g030c8" ) |
|
64 |
# set ( ARENA_BOARD "stm32g441kb" ) |
|
65 |
endif( NOT ARENA_BOARD ) |
|
43 |
if ( NOT ARENA_BOARD ) |
|
44 |
# Does not work at the moment |
|
45 |
# set ( ARENA_BOARD "st_discovery_f072" ) |
|
46 |
# set ( ARENA_BOARD "st_discovery_f407" ) |
|
47 |
#------------------------------------ |
|
48 | ||
49 |
# set ( ARENA_BOARD "st_nucleo_f303" ) |
|
50 |
set ( ARENA_BOARD "stm32l011f4" ) |
|
51 |
# set ( ARENA_BOARD "stm32l151c6" ) |
|
52 |
# set ( ARENA_BOARD "stm32l152c8" ) |
|
53 |
# set ( ARENA_BOARD "stm32l152r6" ) |
|
54 |
# set ( ARENA_BOARD "stm32l431rc" ) |
|
55 |
# set ( ARENA_BOARD "stm32f303" ) |
|
56 |
# set ( ARENA_BOARD "stm32f103c6" ) |
|
57 |
# set ( ARENA_BOARD "stm32l443cc" ) |
|
58 |
# set ( ARENA_BOARD "stm32l031f6" ) |
|
59 |
# set ( ARENA_BOARD "stm32f042f6" ) |
|
60 |
# set ( ARENA_BOARD "stm32f042g4" ) |
|
61 |
# set ( ARENA_BOARD "stm32f042g6" ) |
|
62 |
# set ( ARENA_BOARD "stm32g030c8" ) |
|
63 |
# set ( ARENA_BOARD "stm32g441kb" ) |
|
64 |
endif( NOT ARENA_BOARD ) |
|
65 |
else( NOT HOST ) |
|
66 |
set ( ARENA_BOARD "qt" ) |
|
67 |
set ( ARENA_FRAMEWORK "qt" ) |
|
68 |
endif( NOT HOST ) |
|
66 | 69 | |
67 | 70 |
set ( ARENA_APP "sthello" ) |
68 | 71 | |
69 | 72 |
find_package( Biwak REQUIRED ) |
70 | 73 |
find_package( Arena REQUIRED ) |
71 |
find_package( ArenaFlash REQUIRED ) |
|
74 |
if( NOT HOST ) |
|
75 |
find_package( ArenaFlash REQUIRED ) |
|
76 |
endif( NOT HOST ) |
|
72 | 77 |
find_package( Lepto REQUIRED ) |
73 | 78 | |
74 | 79 |
if( "${MCU_PLATFORM}" MATCHES "stm32" ) |
... | ... | |
94 | 99 |
arena |
95 | 100 |
biwak |
96 | 101 |
lepto |
102 |
) |
|
103 | ||
104 |
if( NOT HOST ) |
|
105 |
target_link_libraries( |
|
106 |
${PROJECT_NAME} |
|
97 | 107 |
stm-${MCU_REV} |
98 | 108 |
syscalls |
99 |
) |
|
109 |
) |
|
110 |
endif() |
|
100 | 111 | |
101 | 112 |
#---Bringup-------------------------------------------------------------------- |
102 | 113 | |
103 | 114 |
project( sthello_bringup ASM C CXX ) |
104 | 115 | |
105 |
find_package(ArenaFlash REQUIRED) |
|
116 |
if( NOT HOST ) |
|
117 |
find_package(ArenaFlash REQUIRED) |
|
118 |
endif( NOT HOST ) |
|
106 | 119 | |
107 | 120 |
add_executable( |
108 | 121 |
${PROJECT_NAME} |
... | ... | |
118 | 131 |
bringup |
119 | 132 |
biwak |
120 | 133 |
lepto |
134 |
) |
|
135 | ||
136 |
if( NOT HOST ) |
|
137 |
target_link_libraries( |
|
138 |
${PROJECT_NAME} |
|
121 | 139 |
stm-${MCU_REV} |
122 | 140 |
syscalls |
123 |
) |
|
141 |
) |
|
142 |
endif() |
|
124 | 143 | |
125 | 144 |
#install( TARGETS ${PROJECT_NAME} |
126 | 145 |
# DESTINATION bin |
127 | 146 |
#) |
128 | 147 | |
129 |
else ( NOT HOST ) |
|
148 |
#---Tests---------------------------------------------------------------------- |
|
149 | ||
150 |
if ( HOSTXXX ) |
|
130 | 151 | |
131 | 152 |
project ( sthello_tests LANGUAGES C CXX ) |
132 | 153 | |
... | ... | |
141 | 162 |
add_subdirectory( liblepto ) |
142 | 163 |
add_subdirectory( libbiwak ) |
143 | 164 | |
144 |
endif( NOT HOST ) |
|
145 | ||
165 |
endif( HOST ) |
|
146 | 166 | |
147 | 167 |
#---fin.----------------------------------------------------------------------- |
arena/apps/sthello.json | ||
---|---|---|
33 | 33 |
"stm32f042gx": "", |
34 | 34 |
"stm32f103cx": "", |
35 | 35 |
"stm32g030cx": "", |
36 |
"qt": "", |
|
36 | 37 |
"stm32l151cx": "uartBootloader", |
37 | 38 |
"other": "uartBootloader" |
38 | 39 |
}, |
... | ... | |
66 | 67 |
"stm32l151cx": "INPUT_NI PA1" |
67 | 68 |
} |
68 | 69 |
}, |
70 |
{ |
|
71 |
"type": "INPUT", |
|
72 |
"name": "interrupt" |
|
73 |
}, |
|
69 | 74 |
{ |
70 | 75 |
"type": "PWM", |
71 | 76 |
"name": "Buzzer", |
libHALWrapper | ||
---|---|---|
1 |
Subproject commit 6a83e49ec859bd837d190327ae69eb4ee6616158 |
|
1 |
Subproject commit edaca10c1e82ec003eb3c84519f7c713e13aba2f |
libarena | ||
---|---|---|
1 |
Subproject commit 876325ecf68d74f597613c29a0667572b92d8f90 |
|
1 |
Subproject commit c34cd161fc497bfe13d011797cc563073e768c0c |
libbiwak | ||
---|---|---|
1 |
Subproject commit 0a673da683236603e2ddd71de55ba9f42304513d |
|
1 |
Subproject commit a008179b03a6673877a337dbdc97b7fdb5abe3ec-dirty |
libcampo | ||
---|---|---|
1 |
Subproject commit 6a0a8d947a98b16bebe8a4a2019a2ad3c747539f |
|
1 |
Subproject commit b5000a411c4c4dfa4675e1c82c30c33b954ce746 |
libfosh | ||
---|---|---|
1 |
Subproject commit 3dcb9f6029790a45245743a41f46f88f23840b09 |
|
1 |
Subproject commit 5444adf91fb50985017f7534046c9c520babc072 |
liblepto | ||
---|---|---|
1 |
Subproject commit d20ad818948d88014af18f943e4d91482d92ca7d |
|
1 |
Subproject commit 3958bf62dbf352baa1dcfe1dce449c7de6fe03da-dirty |
src/main.cpp | ||
---|---|---|
9 | 9 |
//#include <fosh/fosh.hpp> |
10 | 10 |
#include <unistd.h> |
11 | 11 | |
12 |
extern char _sdata[]; |
|
13 |
extern char _edata[]; |
|
14 |
extern char _sbss; |
|
15 |
extern char _ebss; |
|
16 |
extern char __heap_start[]; |
|
17 |
extern char __heap_end[]; |
|
18 |
extern char _sflash[]; |
|
19 |
extern char _eflash[]; |
|
20 |
extern char _eram[]; |
|
21 |
extern char __stack_size[]; |
|
22 |
extern char __heap_size[]; |
|
23 |
extern char __ram_size[]; |
|
24 |
extern char _sidata[]; |
|
25 | ||
26 |
extern "C" |
|
27 |
{ |
|
28 |
void *biwakMalloc(size_t) |
|
29 |
{ |
|
30 |
return ( &__heap_start ); |
|
31 |
} |
|
32 |
} |
|
33 | 12 | |
34 | 13 |
int main(int argc, char *argv[]) |
35 | 14 |
{ |
36 |
uint32_t hs=(uint32_t)&__heap_start; |
|
37 |
uint32_t he=(uint32_t)&__heap_end; |
|
38 |
uint32_t br=(uint32_t)sbrk(0); |
|
39 |
|
|
40 | 15 |
biwakInit(); |
41 | 16 |
arenaInit(); |
42 |
//static_assert( he > hs ); |
|
43 | 17 |
|
44 |
//exception( "ddd", sizeof(CPlatform) ); |
|
45 | 18 |
CPlatform *pPlatform = new CPlatform; |
46 | 19 |
setStdio( &pPlatform->m_uartDebug ); |
47 | 20 |
CHeartBeat heartBeat( pPlatform->m_ledHeartbeat ); |
48 | 21 | |
49 |
uint32_t br2=(uint32_t)sbrk(0); |
|
50 |
register int *sp asm ("sp"); |
|
51 |
|
|
52 | 22 |
printf("-----------------\n"); |
53 |
printf("Ram total: %ul\n", (unsigned int)&__ram_size); |
|
54 |
#if 0 |
|
55 |
printf("Heap start: 0x%X\n", (unsigned int)hs); |
|
56 |
printf("Heap end: 0x%X\n", (unsigned int)he); |
|
57 |
printf("Heap size (min) %d\n", (unsigned int)&__heap_size); |
|
58 |
printf("Heap size %d\n", (unsigned int)(he-hs) ); |
|
59 |
printf("Stack size (min) %d\n", (unsigned int)&__stack_size); |
|
60 |
printf("Stack size (calc)%d\n", (unsigned int)( (uint32_t)_eram - he) ); |
|
61 |
printf("Start br: 0x%X\n", (unsigned int)br); |
|
62 |
printf("Current br: 0x%X\n", (unsigned int)br2); |
|
63 |
printf("Sizeof platform: %d\n", sizeof(CPlatform)); |
|
64 |
printf("Free heap: %d\n", (unsigned int)(he - br2) ); |
|
65 |
printf("SP 0x%X\n", (unsigned int)sp); |
|
66 |
printf("Binary size %d\n", (unsigned int)( ( _sidata + (_edata-_sdata)) - _sflash ) ); |
|
67 |
#endif |
|
68 |
|
|
69 |
/* |
|
70 |
char buf[0x10]; |
|
71 |
snprintf(buf, 0x10, "%s %d", "Hallo", 456); |
|
72 |
lInfo("Information %d", 123); |
|
73 |
pPlatform->m_uartDebug.puts("XYZ\n"); |
|
74 |
lInfo("Warning 0x%x", 0xaffe); |
|
75 |
lCritical("Ui %b", 0xaffe); |
|
76 |
*/ |
|
77 |
#if 0 |
|
78 |
struct S{ |
|
79 |
char c; |
|
80 |
uint64_t value; |
|
81 |
} __attribute(( packed )); |
|
82 | ||
83 |
S s { .value=0x7777666611223344 }; |
|
84 |
uint64_t *p=&s.value; |
|
85 |
//printf("uint32_t: 0x%X@%p %X %X %X\n", *p, p); |
|
86 |
#endif |
|
87 | ||
88 |
CBringup bringup; |
|
89 | ||
90 |
//bringup.addTest( new CTestInternFlash ); |
|
91 | ||
92 |
CBringupWriterMd writer( bringup ); |
|
93 |
//writer.printSoftwareInfo(); |
|
94 |
//writer.printProtocoll(); |
|
95 | 23 | |
96 | 24 |
while(1) |
97 | 25 |
{ |
src/main_bringup.cpp | ||
---|---|---|
9 | 9 |
//#include <fosh/fosh.hpp> |
10 | 10 |
#include <unistd.h> |
11 | 11 | |
12 |
extern char _sdata[]; |
|
13 |
extern char _edata[]; |
|
14 |
extern char _sbss; |
|
15 |
extern char _ebss; |
|
16 |
extern char __heap_start[]; |
|
17 |
extern char __heap_end[]; |
|
18 |
extern char _sflash[]; |
|
19 |
extern char _eflash[]; |
|
20 |
extern char _eram[]; |
|
21 |
extern char __stack_size[]; |
|
22 |
extern char __heap_size[]; |
|
23 |
extern char __ram_size[]; |
|
24 |
extern char _sidata[]; |
|
25 | ||
26 |
extern "C" |
|
27 |
{ |
|
28 |
void *biwakMalloc(size_t) |
|
29 |
{ |
|
30 |
return ( &__heap_start ); |
|
31 |
} |
|
32 |
} |
|
33 | 12 | |
34 | 13 |
int main(int argc, char *argv[]) |
35 | 14 |
{ |
36 |
uint32_t hs=(uint32_t)&__heap_start; |
|
37 |
uint32_t he=(uint32_t)&__heap_end; |
|
38 |
uint32_t br=(uint32_t)sbrk(0); |
|
39 |
|
|
40 | 15 |
biwakInit(); |
41 | 16 |
arenaInit(); |
42 | 17 |
|
... | ... | |
44 | 19 |
setStdio( &pPlatform->m_uartDebug ); |
45 | 20 |
CHeartBeat heartBeat( pPlatform->m_ledHeartbeat ); |
46 | 21 |
|
22 |
#if 1 |
|
23 | ||
47 | 24 |
CBringup bringup; |
48 | 25 | |
49 | 26 |
lInfo("Starting BU..."); |
50 | 27 | |
51 |
//bringup.addTest( new CTestCrc ); |
|
28 |
#if defined STM32 |
|
29 |
bringup.addTest( new CTestCrc ); |
|
30 |
#endif |
|
52 | 31 |
//bringup.addTest( new CTestInternFlash ); |
53 | 32 | |
54 | 33 |
CBringupWriterMd writer( bringup ); |
55 |
//writer.printSoftwareInfo(); |
|
56 |
//writer.printProtocoll(); |
|
34 |
writer.printSoftwareInfo(); |
|
35 |
writer.printProtocoll(); |
|
36 | ||
37 |
#endif |
|
57 | 38 | |
58 | 39 |
while(1) |
59 | 40 |
{ |