Skip to content

Commit 50a79e9

Browse files
Fix some warnings, add COMPONENT_SPIF, add upload method instructions
1 parent d53849f commit 50a79e9

File tree

7 files changed

+46
-15
lines changed

7 files changed

+46
-15
lines changed

connectivity/drivers/emac/sources/CompositeEMAC.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ namespace mbed {
8282
return;
8383
}
8484

85+
#if MBED_TRACE_MAX_LEVEL >= TRACE_LEVEL_INFO
8586
char const * speedStr;
8687
if(speed == LinkSpeed::LINK_10MBIT) {
8788
speedStr = "10Mbps";
@@ -94,6 +95,7 @@ namespace mbed {
9495
}
9596

9697
tr_info("Link up at %s %s duplex", speedStr, duplex == Duplex::FULL ? "full" : "half");
98+
#endif
9799

98100
linkState = LinkState::UP;
99101
if(mac.enable(speed, duplex) != ErrCode::SUCCESS) {

storage/blockdevice/COMPONENT_SPIF/mbed_lib.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@
7070
},
7171
"ARDUINO_NICLA_SENSE_ME": {
7272
"SPI_CS": "CS_FLASH"
73-
}
73+
},
74+
"NUMAKER_PFM_M487": {
75+
"SPI_MOSI": "PC_0",
76+
"SPI_MISO": "PC_1",
77+
"SPI_CLK": "PC_2",
78+
"SPI_CS": "PC_3"
79+
}
7480
}
7581
}

storage/blockdevice/tests/TESTS/blockdevice/general_block_device/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ void test_contiguous_erase_write_read()
738738
}
739739
}
740740

741-
free(write_read_buf);
741+
delete[] write_read_buf;
742742
}
743743

744744
void test_program_read_small_data_sizes()
@@ -867,7 +867,7 @@ void test_write_deinit_init()
867867

868868
for (int i = 0; i < 3; i++) {
869869
// Generate test pattern
870-
for (int j = 0; j < prog_size; j++) {
870+
for (bd_size_t j = 0; j < prog_size; j++) {
871871
prog[j] = (uint8_t)'0' + i + j;
872872
}
873873

targets/TARGET_NUVOTON/nu_miscutil.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,31 @@ void nu_nop(uint32_t n)
4040
switch (rmn) {
4141
case 9:
4242
__NOP();
43+
// fall through
4344
case 8:
4445
__NOP();
46+
// fall through
4547
case 7:
4648
__NOP();
49+
// fall through
4750
case 6:
4851
__NOP();
52+
// fall through
4953
case 5:
5054
__NOP();
55+
// fall through
5156
case 4:
5257
__NOP();
58+
// fall through
5359
case 3:
5460
__NOP();
61+
// fall through
5562
case 2:
5663
__NOP();
64+
// fall through
5765
case 1:
5866
__NOP();
67+
// fall through
5968
default:
6069
break;
6170
}

targets/targets.json5

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8230,6 +8230,12 @@ mode is recommended for target MCUs with small amounts of flash and RAM.",
82308230
"detect_code": [
82318231
"1304"
82328232
],
8233+
"components_add": [
8234+
"SPIF" // 4MiB SPI flash.
8235+
8236+
// Note that this board also has a MicroSD slot, but it is not hooked up to the right pins for SPI
8237+
// operation, so Mbed currently cannot use it.
8238+
],
82338239
"overrides": {
82348240
"hxt-present": false,
82358241
"lxt-present": true,

targets/upload_method_cfg/NUMAKER_IOT_M487.cmake

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
# To change any of these parameters from their default values, set them in your build script between where you
33
# include app.cmake and where you add mbed os as a subdirectory.
44

5+
# Notes:
6+
# 1. The Nuvoton fork of OpenOCD is required: https://github.com/OpenNuvoton/OpenOCD-Nuvoton/releases .
7+
# Point CMake to it via setting the OpenOCD option:
8+
# -DOpenOCD="C:/Program Files (x86)/OpenOCD-nuvoton/bin/openocd.exe"
9+
# 2. Take note of the "MSG" switch on the Nu-Link section of the board. If set to ON, the Nu-Link will run in
10+
# mass storage mode and can only work with the "MBED" upload method. If set to OFF, the Nu-Link will run in
11+
# Nu-Link mode and only works with Nuvoton OpenOCD.
12+
# 3. On Windows you will need to install the Nu-Link Keil USB driver, which can be found near the bottom here:
13+
# https://www.nuvoton.com/tool-and-software/ide-and-compiler/
14+
515
# General config parameters
616
# -------------------------------------------------------------
717
set(UPLOAD_METHOD_DEFAULT MBED)
@@ -11,12 +21,6 @@ set(UPLOAD_METHOD_DEFAULT MBED)
1121
set(MBED_UPLOAD_ENABLED TRUE)
1222
set(MBED_RESET_BAUDRATE 115200)
1323

14-
# Config options for PYOCD
15-
# -------------------------------------------------------------
16-
set(PYOCD_UPLOAD_ENABLED TRUE)
17-
set(PYOCD_TARGET_NAME m487jidae)
18-
set(PYOCD_CLOCK_SPEED 4000k)
19-
2024
# Config options for OPENOCD
2125
# -------------------------------------------------------------
2226
set(OPENOCD_UPLOAD_ENABLED TRUE)

targets/upload_method_cfg/NUMAKER_PFM_M487.cmake

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
# To change any of these parameters from their default values, set them in your build script between where you
33
# include app.cmake and where you add mbed os as a subdirectory.
44

5+
# Notes:
6+
# 1. The Nuvoton fork of OpenOCD is required: https://github.com/OpenNuvoton/OpenOCD-Nuvoton/releases .
7+
# Point CMake to it via setting the OpenOCD option:
8+
# -DOpenOCD="C:/Program Files (x86)/OpenOCD-nuvoton/bin/openocd.exe"
9+
# 2. Take note of the "MSG" switch on the Nu-Link section of the board. If set to ON, the Nu-Link will run in
10+
# mass storage mode and can only work with the "MBED" upload method. If set to OFF, the Nu-Link will run in
11+
# Nu-Link mode and only works with Nuvoton OpenOCD.
12+
# 3. On Windows you will need to install the Nu-Link Keil USB driver, which can be found near the bottom here:
13+
# https://www.nuvoton.com/tool-and-software/ide-and-compiler/
14+
515
# General config parameters
616
# -------------------------------------------------------------
717
set(UPLOAD_METHOD_DEFAULT MBED)
@@ -11,12 +21,6 @@ set(UPLOAD_METHOD_DEFAULT MBED)
1121
set(MBED_UPLOAD_ENABLED TRUE)
1222
set(MBED_RESET_BAUDRATE 115200)
1323

14-
# Config options for PYOCD
15-
# -------------------------------------------------------------
16-
set(PYOCD_UPLOAD_ENABLED TRUE)
17-
set(PYOCD_TARGET_NAME m487jidae)
18-
set(PYOCD_CLOCK_SPEED 4000k)
19-
2024
# Config options for OPENOCD
2125
# -------------------------------------------------------------
2226
set(OPENOCD_UPLOAD_ENABLED TRUE)

0 commit comments

Comments
 (0)