Skip to content

Commit 45d75d1

Browse files
committed
Update Zephyr to v2.3.0
1 parent c509144 commit 45d75d1

File tree

4 files changed

+109
-38
lines changed

4 files changed

+109
-38
lines changed

boards/lpcxpresso55s16.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"build": {
3+
"cpu": "cortex-m33",
4+
"f_cpu": "150000000L",
5+
"mcu": "lpc55s16",
6+
"zephyr": {
7+
"variant": "lpcxpresso55s16_ns"
8+
}
9+
},
10+
"connectivity": [
11+
"ethernet"
12+
],
13+
"debug": {
14+
"jlink_device": "LPC55S16",
15+
"onboard_tools": [
16+
"jlink"
17+
]
18+
},
19+
"frameworks": [
20+
"zephyr"
21+
],
22+
"name": "NXP LPCXpresso55S16",
23+
"upload": {
24+
"maximum_ram_size": 98304,
25+
"maximum_size": 262144,
26+
"protocol": "jlink",
27+
"protocols": [
28+
"jlink",
29+
"mbed"
30+
]
31+
},
32+
"url": "https://www.nxp.com/design/development-boards/lpcxpresso-boards/lpcxpresso55s16-development-board:LPC55S16-EVK",
33+
"vendor": "NXP"
34+
}

examples/zephyr-blink/src/main.c

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,52 @@
66

77
#include <zephyr.h>
88
#include <device.h>
9+
#include <devicetree.h>
910
#include <drivers/gpio.h>
1011

11-
#define LED_PORT DT_ALIAS_LED0_GPIOS_CONTROLLER
12-
#define LED DT_ALIAS_LED0_GPIOS_PIN
1312

1413
/* 1000 msec = 1 sec */
15-
#define SLEEP_TIME 1000
14+
#define SLEEP_TIME_MS 1000
15+
16+
/* The devicetree node identifier for the "led0" alias. */
17+
#define LED0_NODE DT_ALIAS(led0)
18+
19+
#if DT_NODE_HAS_STATUS(LED0_NODE, okay)
20+
#define LED0 DT_GPIO_LABEL(LED0_NODE, gpios)
21+
#define PIN DT_GPIO_PIN(LED0_NODE, gpios)
22+
#if DT_PHA_HAS_CELL(LED0_NODE, gpios, flags)
23+
#define FLAGS DT_GPIO_FLAGS(LED0_NODE, gpios)
24+
#endif
25+
#else
26+
/* A build error here means your board isn't set up to blink an LED. */
27+
#error "Unsupported board: led0 devicetree alias is not defined"
28+
#define LED0 ""
29+
#define PIN 0
30+
#endif
31+
32+
#ifndef FLAGS
33+
#define FLAGS 0
34+
#endif
1635

1736
void main(void)
1837
{
19-
u32_t cnt = 0;
2038
struct device *dev;
39+
bool led_is_on = true;
40+
int ret = 0;
2141

22-
dev = device_get_binding(LED_PORT);
23-
/* Set LED pin as output */
24-
gpio_pin_configure(dev, LED, GPIO_DIR_OUT);
42+
dev = device_get_binding(LED0);
43+
if (dev == NULL) {
44+
return;
45+
}
46+
47+
ret = gpio_pin_configure(dev, PIN, GPIO_OUTPUT_ACTIVE | FLAGS);
48+
if (ret < 0) {
49+
return;
50+
}
2551

2652
while (1) {
27-
/* Set pin to HIGH/LOW every 1 second */
28-
gpio_pin_write(dev, LED, cnt % 2);
29-
cnt++;
30-
k_sleep(SLEEP_TIME);
53+
gpio_pin_set(dev, PIN, (int)led_is_on);
54+
led_is_on = !led_is_on;
55+
k_msleep(SLEEP_TIME_MS);
3156
}
3257
}

examples/zephyr-synchronization/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void helloLoop(const char *my_name,
5252
}
5353

5454
/* wait a while, then let other thread have a turn */
55-
k_sleep(SLEEPTIME);
55+
k_msleep(SLEEPTIME);
5656
k_sem_give(other_sem);
5757
}
5858
}
@@ -98,4 +98,4 @@ void threadA(void *dummy1, void *dummy2, void *dummy3)
9898
}
9999

100100
K_THREAD_DEFINE(thread_a, STACKSIZE, threadA, NULL, NULL, NULL,
101-
PRIORITY, 0, K_NO_WAIT);
101+
PRIORITY, 0, 0);

platform.json

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,71 +39,83 @@
3939
"framework-zephyr": {
4040
"type": "framework",
4141
"optional": true,
42-
"version": "~2.20200.0"
42+
"version": "~2.20300.0"
4343
},
44-
"framework-zephyr-hal-nxp": {
44+
"framework-zephyr-canopennode": {
4545
"optional": true,
46-
"version": "~0.20200.200130"
46+
"version": "0.0.0-alpha+sha.5c6b0566d5"
4747
},
4848
"framework-zephyr-civetweb": {
4949
"optional": true,
50-
"version": "~0.20200.190807"
50+
"version": "0.0.0-alpha+sha.99129c5efc"
51+
},
52+
"framework-zephyr-cmsis": {
53+
"optional": true,
54+
"version": "0.0.0-alpha+sha.542b2296e6"
5155
},
5256
"framework-zephyr-fatfs": {
5357
"optional": true,
54-
"version": "~0.20200.191125"
58+
"version": "0.0.0-alpha+sha.9ee6b9b951"
59+
},
60+
"framework-zephyr-hal-nxp": {
61+
"optional": true,
62+
"version": "0.0.0-alpha+sha.80a337dc4c"
5563
},
5664
"framework-zephyr-libmetal": {
5765
"optional": true,
58-
"version": "~0.20200.190530"
66+
"version": "0.0.0-alpha+sha.3c3c9ec83b"
5967
},
6068
"framework-zephyr-lvgl": {
6169
"optional": true,
62-
"version": "~0.20200.191207"
70+
"version": "0.0.0-alpha+sha.74fc2e753a"
6371
},
6472
"framework-zephyr-mbedtls": {
6573
"optional": true,
66-
"version": "~0.20200.200206"
74+
"version": "0.0.0-alpha+sha.4bf099f125"
75+
},
76+
"framework-zephyr-mcuboot": {
77+
"optional": true,
78+
"version": "0.0.0-alpha+sha.e88113bbeb"
6779
},
6880
"framework-zephyr-mcumgr": {
6981
"optional": true,
70-
"version": "~0.20200.200117"
82+
"version": "0.0.0-alpha+sha.5885efb7ca"
7183
},
7284
"framework-zephyr-open-amp": {
7385
"optional": true,
74-
"version": "~0.20200.190612"
86+
"version": "0.0.0-alpha+sha.724f7e2a45"
87+
},
88+
"framework-zephyr-loramac-node": {
89+
"optional": true,
90+
"version": "0.0.0-alpha+sha.29e516ec58"
7591
},
7692
"framework-zephyr-openthread": {
7793
"optional": true,
78-
"version": "~0.20200.191014"
94+
"version": "0.0.0-alpha+sha.a83d18cf18"
7995
},
8096
"framework-zephyr-segger": {
8197
"optional": true,
82-
"version": "~0.20200.190421"
98+
"version": "0.0.0-alpha+sha.6fcf61606d"
8399
},
84100
"framework-zephyr-tinycbor": {
85101
"optional": true,
86-
"version": "~0.20200.191016"
87-
},
88-
"framework-zephyr-littlefs": {
89-
"optional": true,
90-
"version": "~0.20200.190811"
102+
"version": "0.0.0-alpha+sha.40daca97b4"
91103
},
92-
"framework-zephyr-mipi-sys-t": {
104+
"framework-zephyr-tinycrypt": {
93105
"optional": true,
94-
"version": "~0.20200.191024"
106+
"version": "0.0.0-alpha+sha.3e9a49d267"
95107
},
96-
"framework-zephyr-canopennode": {
108+
"framework-zephyr-littlefs": {
97109
"optional": true,
98-
"version": "~0.20200.200115"
110+
"version": "0.0.0-alpha+sha.0aefdda69d"
99111
},
100-
"framework-zephyr-loramac-node": {
112+
"framework-zephyr-mipi-sys-t": {
101113
"optional": true,
102-
"version": "~0.20200.191220"
114+
"version": "0.0.0-alpha+sha.957d46bc3c"
103115
},
104-
"framework-zephyr-mcuboot": {
116+
"framework-zephyr-trusted-firmware-m": {
105117
"optional": true,
106-
"version": "~0.20200.200219"
118+
"version": "0.0.0-alpha+sha.7de2daa196"
107119
},
108120
"tool-openocd": {
109121
"type": "debugger",

0 commit comments

Comments
 (0)