Skip to content

Commit 509c187

Browse files
committed
Update Zephyr to v2.5.0
1 parent 241dc20 commit 509c187

File tree

4 files changed

+61
-39
lines changed

4 files changed

+61
-39
lines changed

examples/zephyr-blink/src/main.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <devicetree.h>
1010
#include <drivers/gpio.h>
1111

12-
1312
/* 1000 msec = 1 sec */
1413
#define SLEEP_TIME_MS 1000
1514

@@ -19,25 +18,20 @@
1918
#if DT_NODE_HAS_STATUS(LED0_NODE, okay)
2019
#define LED0 DT_GPIO_LABEL(LED0_NODE, gpios)
2120
#define PIN DT_GPIO_PIN(LED0_NODE, gpios)
22-
#if DT_PHA_HAS_CELL(LED0_NODE, gpios, flags)
2321
#define FLAGS DT_GPIO_FLAGS(LED0_NODE, gpios)
24-
#endif
2522
#else
2623
/* A build error here means your board isn't set up to blink an LED. */
2724
#error "Unsupported board: led0 devicetree alias is not defined"
2825
#define LED0 ""
2926
#define PIN 0
30-
#endif
31-
32-
#ifndef FLAGS
3327
#define FLAGS 0
3428
#endif
3529

3630
void main(void)
3731
{
38-
struct device *dev;
32+
const struct device *dev;
3933
bool led_is_on = true;
40-
int ret = 0;
34+
int ret;
4135

4236
dev = device_get_binding(LED0);
4337
if (dev == NULL) {

examples/zephyr-synchronization/src/main.c

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,31 @@ void helloLoop(const char *my_name,
3636
struct k_sem *my_sem, struct k_sem *other_sem)
3737
{
3838
const char *tname;
39+
uint8_t cpu;
40+
struct k_thread *current_thread;
3941

4042
while (1) {
4143
/* take my semaphore */
4244
k_sem_take(my_sem, K_FOREVER);
4345

46+
current_thread = k_current_get();
47+
tname = k_thread_name_get(current_thread);
48+
#if CONFIG_SMP
49+
cpu = arch_curr_cpu()->id;
50+
#else
51+
cpu = 0;
52+
#endif
4453
/* say "hello" */
45-
tname = k_thread_name_get(k_current_get());
46-
if (tname != NULL && tname[0] != '\0') {
47-
printk("%s: Hello World from %s!\n",
48-
tname, CONFIG_BOARD);
54+
if (tname == NULL) {
55+
printk("%s: Hello World from cpu %d on %s!\n",
56+
my_name, cpu, CONFIG_BOARD);
4957
} else {
50-
printk("%s: Hello World from %s!\n",
51-
my_name, CONFIG_BOARD);
58+
printk("%s: Hello World from cpu %d on %s!\n",
59+
tname, cpu, CONFIG_BOARD);
5260
}
5361

5462
/* wait a while, then let other thread have a turn */
63+
k_busy_wait(100000);
5564
k_msleep(SLEEPTIME);
5665
k_sem_give(other_sem);
5766
}
@@ -89,9 +98,14 @@ void threadA(void *dummy1, void *dummy2, void *dummy3)
8998
/* spawn threadB */
9099
k_tid_t tid = k_thread_create(&threadB_data, threadB_stack_area,
91100
STACKSIZE, threadB, NULL, NULL, NULL,
92-
PRIORITY, 0, K_NO_WAIT);
101+
PRIORITY, 0, K_FOREVER);
93102

94103
k_thread_name_set(tid, "thread_b");
104+
#if CONFIG_SCHED_CPU_MASK
105+
k_thread_cpu_mask_disable(&threadB_data, 1);
106+
k_thread_cpu_mask_enable(&threadB_data, 0);
107+
#endif
108+
k_thread_start(&threadB_data);
95109

96110
/* invoke routine to ping-pong hello messages with threadB */
97111
helloLoop(__func__, &threadA_sem, &threadB_sem);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
CONFIG_STDOUT_CONSOLE=y
22
# enable to use thread names
3-
#CONFIG_THREAD_NAME=y
3+
CONFIG_THREAD_NAME=y

platform.json

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"homepage": "http://www.nxp.com/products/microcontrollers/",
66
"license": "Apache-2.0",
77
"keywords": [
8-
"dev-platform",
9-
"ARM",
10-
"Cortex-M",
11-
"NXP Semiconductors",
12-
"LPC"
8+
"dev-platform",
9+
"ARM",
10+
"Cortex-M",
11+
"NXP Semiconductors",
12+
"LPC"
1313
],
1414
"engines": {
1515
"platformio": "^5"
@@ -34,25 +34,29 @@
3434
"type": "toolchain",
3535
"owner": "platformio",
3636
"version": "~1.80201.0",
37-
"optionalVersions": ["~1.90201.0"]
37+
"optionalVersions": [
38+
"~1.90201.0"
39+
]
3840
},
3941
"framework-mbed": {
4042
"type": "framework",
4143
"optional": true,
4244
"owner": "platformio",
4345
"version": "~6.60600.0",
44-
"optionalVersions": ["~6.51506.0"]
46+
"optionalVersions": [
47+
"~6.51506.0"
48+
]
4549
},
4650
"framework-zephyr": {
4751
"type": "framework",
4852
"optional": true,
4953
"owner": "platformio",
50-
"version": "~2.20400.0"
54+
"version": "~2.20500.0"
5155
},
5256
"framework-zephyr-cmsis": {
5357
"optional": true,
5458
"owner": "platformio",
55-
"version": "0.0.0-alpha+sha.542b2296e6"
59+
"version": "0.0.0-alpha+sha.c3bd2094f9"
5660
},
5761
"framework-zephyr-canopennode": {
5862
"optional": true,
@@ -62,52 +66,52 @@
6266
"framework-zephyr-civetweb": {
6367
"optional": true,
6468
"owner": "platformio",
65-
"version": "0.0.0-alpha+sha.99129c5efc"
69+
"version": "0.0.0-alpha+sha.e6903b80c0"
6670
},
6771
"framework-zephyr-fatfs": {
6872
"optional": true,
6973
"owner": "platformio",
70-
"version": "0.0.0-alpha+sha.13697783bf"
74+
"version": "0.0.0-alpha+sha.1d1fcc725a"
7175
},
7276
"framework-zephyr-hal-st": {
7377
"optional": true,
7478
"owner": "platformio",
75-
"version": "0.0.0-alpha+sha.5b3ec3e182"
79+
"version": "0.0.0-alpha+sha.b52fdbf4b6"
7680
},
7781
"framework-zephyr-hal-nxp": {
7882
"optional": true,
7983
"owner": "platformio",
80-
"version": "0.0.0-alpha+sha.68bbdbdec1"
84+
"version": "0.0.0-alpha+sha.b916bca1d5"
8185
},
8286
"framework-zephyr-libmetal": {
8387
"optional": true,
8488
"owner": "platformio",
85-
"version": "0.0.0-alpha+sha.0b23894a04"
89+
"version": "0.0.0-alpha+sha.9d4ee2c3cf"
8690
},
8791
"framework-zephyr-lvgl": {
8892
"optional": true,
8993
"owner": "platformio",
90-
"version": "0.0.0-alpha+sha.928b61c7c8"
94+
"version": "0.0.0-alpha+sha.31acbaa36e"
9195
},
9296
"framework-zephyr-mbedtls": {
9397
"optional": true,
9498
"owner": "platformio",
95-
"version": "0.0.0-alpha+sha.aef137b1af"
99+
"version": "0.0.0-alpha+sha.24d84ecff1"
96100
},
97101
"framework-zephyr-mcuboot": {
98102
"optional": true,
99103
"owner": "platformio",
100-
"version": "0.0.0-alpha+sha.a5d79cf8cc"
104+
"version": "0.0.0-alpha+sha.3fc59410b6"
101105
},
102106
"framework-zephyr-mcumgr": {
103107
"optional": true,
104108
"owner": "platformio",
105-
"version": "0.0.0-alpha+sha.5051f9d900"
109+
"version": "0.0.0-alpha+sha.43845e883f"
106110
},
107111
"framework-zephyr-open-amp": {
108112
"optional": true,
109113
"owner": "platformio",
110-
"version": "0.0.0-alpha+sha.724f7e2a45"
114+
"version": "0.0.0-alpha+sha.de1b85a130"
111115
},
112116
"framework-zephyr-loramac-node": {
113117
"optional": true,
@@ -117,12 +121,17 @@
117121
"framework-zephyr-openthread": {
118122
"optional": true,
119123
"owner": "platformio",
120-
"version": "0.0.0-alpha+sha.07f430dac6"
124+
"version": "0.0.0-alpha+sha.1d668284a0"
121125
},
122126
"framework-zephyr-segger": {
123127
"optional": true,
124128
"owner": "platformio",
125-
"version": "0.0.0-alpha+sha.874d9e9696"
129+
"version": "0.0.0-alpha+sha.38c79a447e"
130+
},
131+
"framework-zephyr-sof": {
132+
"optional": true,
133+
"owner": "platformio",
134+
"version": "0.0.0-alpha+sha.b5b772dd61"
126135
},
127136
"framework-zephyr-tinycbor": {
128137
"optional": true,
@@ -142,12 +151,17 @@
142151
"framework-zephyr-mipi-sys-t": {
143152
"optional": true,
144153
"owner": "platformio",
145-
"version": "0.0.0-alpha+sha.957d46bc3c"
154+
"version": "0.0.0-alpha+sha.75e671550a"
155+
},
156+
"framework-zephyr-tfm-mcuboot": {
157+
"optional": true,
158+
"owner": "platformio",
159+
"version": "1.7.0-rc1"
146160
},
147161
"framework-zephyr-trusted-firmware-m": {
148162
"optional": true,
149163
"owner": "platformio",
150-
"version": "0.0.0-alpha+sha.143df67555"
164+
"version": "0.0.0-alpha+sha.96340fb6c0"
151165
},
152166
"tool-openocd": {
153167
"type": "debugger",

0 commit comments

Comments
 (0)