• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Revision15626 (tree)
Time2022-05-16 17:33:48
Authorgdisirio

Log Message

Fixed regression in the demo.

Change Summary

Incremental Difference

--- trunk/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_DYNAMIC/main.c (revision 15625)
+++ trunk/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_DYNAMIC/main.c (revision 15626)
@@ -65,10 +65,12 @@
6565 .regions = {
6666 [0] = {
6767 .area = {STARTUP_FLASH1_BASE, STARTUP_FLASH1_SIZE},
68+ .used = true,
6869 .writeable = false
6970 },
7071 [1] = {
7172 .area = {STARTUP_RAM1_BASE, STARTUP_RAM1_SIZE},
73+ .used = true,
7274 .writeable = true
7375 }
7476 },
@@ -95,10 +97,12 @@
9597 .regions = {
9698 [0] = {
9799 .area = {STARTUP_FLASH2_BASE, STARTUP_FLASH2_SIZE},
100+ .used = true,
98101 .writeable = false
99102 },
100103 [1] = {
101104 .area = {STARTUP_RAM2_BASE, STARTUP_RAM2_SIZE},
105+ .used = true,
102106 .writeable = true
103107 }
104108 },
@@ -118,6 +122,24 @@
118122 },
119123 };
120124
125+static const char *sbx1_argv[] = {
126+ "sbx1",
127+ NULL
128+};
129+
130+static const char *sbx1_envp[] = {
131+ NULL
132+};
133+
134+static const char *sbx2_argv[] = {
135+ "sbx2",
136+ NULL
137+};
138+
139+static const char *sbx2_envp[] = {
140+ NULL
141+};
142+
121143 /* Sandbox objects.*/
122144 sb_class_t sbx1, sbx2;
123145
@@ -215,7 +237,7 @@
215237 /* Starting sandboxed thread 1.*/
216238 utp1 = sbStartThread(&sbx1, "sbx1",
217239 waUnprivileged1, sizeof (waUnprivileged1),
218- NORMALPRIO - 1, NULL, NULL);
240+ NORMALPRIO - 1, sbx1_argv, sbx1_envp);
219241 if (utp1 == NULL) {
220242 chSysHalt("sbx1 failed");
221243 }
@@ -223,7 +245,7 @@
223245 /* Starting sandboxed thread 2.*/
224246 utp2 = sbStartThread(&sbx2, "sbx2",
225247 waUnprivileged2, sizeof (waUnprivileged2),
226- NORMALPRIO - 1, NULL, NULL);
248+ NORMALPRIO - 1, sbx2_argv, sbx2_envp);
227249 if (utp1 == NULL) {
228250 chSysHalt("sbx2 failed");
229251 }
--- trunk/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_STATIC/main.c (revision 15625)
+++ trunk/demos/STM32/RT-STM32G474RE-NUCLEO64-SB_HOST_STATIC/main.c (revision 15626)
@@ -65,10 +65,12 @@
6565 .regions = {
6666 [0] = {
6767 .area = {STARTUP_FLASH1_BASE, STARTUP_FLASH1_SIZE},
68+ .used = true,
6869 .writeable = false
6970 },
7071 [1] = {
7172 .area = {STARTUP_RAM1_BASE, STARTUP_RAM1_SIZE},
73+ .used = true,
7274 .writeable = true
7375 }
7476 },
@@ -82,10 +84,12 @@
8284 .regions = {
8385 [0] = {
8486 .area = {STARTUP_FLASH2_BASE, STARTUP_FLASH2_SIZE},
87+ .used = true,
8588 .writeable = false
8689 },
8790 [1] = {
8891 .area = {STARTUP_RAM2_BASE, STARTUP_RAM2_SIZE},
92+ .used = true,
8993 .writeable = true
9094 }
9195 },
@@ -92,6 +96,24 @@
9296 // .vfs_driver = (vfs_driver_c *)&root_overlay_driver
9397 };
9498
99+static const char *sbx1_argv[] = {
100+ "sbx1",
101+ NULL
102+};
103+
104+static const char *sbx1_envp[] = {
105+ NULL
106+};
107+
108+static const char *sbx2_argv[] = {
109+ "sbx2",
110+ NULL
111+};
112+
113+static const char *sbx2_envp[] = {
114+ NULL
115+};
116+
95117 /* Sandbox objects.*/
96118 sb_class_t sbx1, sbx2;
97119
@@ -207,7 +229,7 @@
207229 /* Starting sandboxed thread 1.*/
208230 utp1 = sbStartThread(&sbx1, "sbx1",
209231 waUnprivileged1, sizeof (waUnprivileged1),
210- NORMALPRIO - 1, NULL, NULL);
232+ NORMALPRIO - 1, sbx1_argv, sbx1_envp);
211233 if (utp1 == NULL) {
212234 chSysHalt("sbx1 failed");
213235 }
@@ -215,7 +237,7 @@
215237 /* Starting sandboxed thread 2.*/
216238 utp2 = sbStartThread(&sbx2, "sbx2",
217239 waUnprivileged2, sizeof (waUnprivileged2),
218- NORMALPRIO - 1, NULL, NULL);
240+ NORMALPRIO - 1, sbx2_argv, sbx2_envp);
219241 if (utp1 == NULL) {
220242 chSysHalt("sbx2 failed");
221243 }
Show on old repository browser