Skip to content

Commit 5c080af

Browse files
committed
Add support for the VBLUno51 board
Email from Sarah Marsh (mbed): ************************************ Hi, Here is your daplink board ID: C006 The slug: VBLUNO51 When I execute mbedls, it looks like you have used the DAPLink ID for the NRF51_DK. You need your own unique ID. We are running the tests with the NRF51_DK ID mocked as your platform, but you will need to do the following to be mbed enabled: Please submit a PR against mbed-ls (https://github.com/ARMmbed/mbed-ls), so your board can be detected with our tools. Please also submit a PR against DAPLink (https://github.com/mbedmicro/DAPLink), so that your board is uniquely identifiable. Thanks, Sarah ************************************ The VBLUno51 board was added to mbed-os 5.5.2 released ARMmbed/mbed-os#4629 ARMmbed/mbed-os#4719 Signed-off-by: iotvietmember <robotden@gmail.com>
1 parent 2f498fe commit 5c080af

File tree

6 files changed

+170
-3
lines changed

6 files changed

+170
-3
lines changed

projects.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,8 @@ projects:
277277
sam3u2c_ncs36510rf_if:
278278
- *module_if
279279
- *module_hic_sam3u2c
280-
- records/board/ncs36510rf.yaml
280+
- records/board/ncs36510rf.yaml
281+
lpc11u35_vbluno51_if:
282+
- *module_if
283+
- *module_hic_lpc11u35
284+
- records/board/vbluno51.yaml

records/board/vbluno51.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
common:
2+
macros:
3+
- IO_CONFIG_OVERRIDE
4+
includes:
5+
- source/board/override_vbluno51
6+
sources:
7+
board:
8+
- source/board/vbluno51.c
9+
target:
10+
- source/target/nordic/nrf51822/target_32.c
11+
- source/target/nordic/target_reset.c
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/**
2+
* @file IO_Config_Override.c
3+
* @brief Alternative IO for LPC11U35 based Hardware Interface Circuit
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2009-2017, ARM Limited, All Rights Reserved
7+
* SPDX-License-Identifier: Apache-2.0
8+
*
9+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
10+
* not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
22+
#ifndef __IO_CONFIG_H__
23+
#define __IO_CONFIG_H__
24+
25+
#include "LPC11Uxx.h"
26+
#include "daplink.h"
27+
28+
// This GPIO configuration is only valid for the LPC11U35 HIC
29+
COMPILER_ASSERT(DAPLINK_HIC_ID == DAPLINK_HIC_ID_LPC11U35);
30+
31+
// Peripheral register bit masks (used for pin inits)
32+
#define FUNC_0 0
33+
#define FUNC_1 1
34+
#define PULL_DOWN_ENABLED (1 << 3)
35+
#define PULL_UP_ENABLED (2 << 3)
36+
#define OPENDRAIN (1 << 10)
37+
38+
// DAP LED PIO0_21
39+
#define PIN_DAP_LED_PORT 0
40+
#define PIN_DAP_LED_BIT 21
41+
#define PIN_DAP_LED (1 << PIN_DAP_LED_BIT)
42+
#define PIN_DAP_LED_IOCON LPC_IOCON->PIO0_21
43+
#define PIN_DAP_LED_IOCON_INIT (FUNC_0 | PULL_UP_ENABLED)
44+
45+
// MSD LED PIO0_20
46+
#define PIN_MSD_LED_PORT 0
47+
#define PIN_MSD_LED_BIT 20
48+
#define PIN_MSD_LED (1 << PIN_MSD_LED_BIT)
49+
#define PIN_MSD_LED_IOCON LPC_IOCON->PIO0_20
50+
#define PIN_MSD_LED_IOCON_INIT (FUNC_0 | PULL_UP_ENABLED)
51+
52+
// CDC LED PIO0_11
53+
#define PIN_CDC_LED_PORT 0
54+
#define PIN_CDC_LED_BIT 11
55+
#define PIN_CDC_LED (1 << PIN_CDC_LED_BIT)
56+
#define PIN_CDC_LED_IOCON LPC_IOCON->TDI_PIO0_11
57+
#define PIN_CDC_LED_IOCON_INIT (FUNC_1 | PULL_UP_ENABLED)
58+
59+
// Non-Forwarded Reset in PIN PIO1_19
60+
#define PIN_RESET_IN_PORT 1
61+
#define PIN_RESET_IN_BIT 19
62+
#define PIN_RESET_IN (1 << PIN_RESET_IN_BIT)
63+
#define PIN_RESET_IN_IOCON LPC_IOCON->PIO1_19
64+
#define PIN_RESET_IN_IOCON_INIT (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
65+
66+
// Forwarded Reset in PIN PIO0_1
67+
#define PIN_RESET_IN_FWRD_PORT 0
68+
#define PIN_RESET_IN_FWRD_BIT 1
69+
#define PIN_RESET_IN_FWRD (1 << PIN_RESET_IN_FWRD_BIT)
70+
#define PIN_RESET_IN_FWRD_IOCON LPC_IOCON->PIO0_1
71+
#define PIN_RESET_IN_FWRD_IOCON_INIT (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
72+
73+
// nRESET OUT Pin PIO0_2
74+
#define PIN_nRESET_PORT 0
75+
#define PIN_nRESET_BIT 2
76+
#define PIN_nRESET (1 << PIN_nRESET_BIT)
77+
#define PIN_nRESET_IOCON LPC_IOCON->PIO0_2
78+
#define PIN_nRESET_IOCON_INIT (FUNC_0 | OPENDRAIN | PULL_UP_ENABLED)
79+
80+
// SWCLK/TCK Pin PIO0_9
81+
#define PIN_SWCLK_PORT 0
82+
#define PIN_SWCLK_BIT 9
83+
#define PIN_SWCLK (1 << PIN_SWCLK_BIT)
84+
#define PIN_SWCLK_TCK_IOCON LPC_IOCON->PIO0_9
85+
#define PIN_SWCLK_TCK_IOCON_INIT (FUNC_0 | PULL_UP_ENABLED)
86+
87+
// SWDIO/TMS In/Out Pin PIO0_8
88+
#define PIN_SWDIO_PORT 0
89+
#define PIN_SWDIO_BIT 8
90+
#define PIN_SWDIO (1 << PIN_SWDIO_BIT)
91+
#define PIN_SWDIO_TMS_IOCON LPC_IOCON->PIO0_8
92+
#define PIN_SWDIO_TMS_IOCON_INIT (FUNC_0 | PULL_UP_ENABLED)
93+
94+
// TDI Pin PIO0_17
95+
#define PIN_TDI_PORT 17
96+
#define PIN_TDI_BIT 17
97+
#define PIN_TDI (1 << PIN_TDI_BIT)
98+
#define PIN_TDI_IOCON LPC_IOCON->PIO0_17
99+
#define PIN_TDI_IOCON_INIT (FUNC_0 | PULL_UP_ENABLED)
100+
101+
// SWO/TDO Pin PIO0_9
102+
#define PIN_TDO_PORT 9
103+
#define PIN_TDO_BIT 9
104+
#define PIN_TDO (1 << PIN_TDO_BIT)
105+
#define PIN_TDO_IOCON LPC_IOCON->PIO0_9
106+
#define PIN_TDO_IOCON_INIT (FUNC_0 | PULL_UP_ENABLED)
107+
108+
#endif

source/board/vbluno51.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* @file vbluno51.c
3+
* @brief Board ID for the VBLUno51 board (VNG Bluetooth Low Energy UNO nRF51822 board)
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2009-2017, ARM Limited, All Rights Reserved
7+
* SPDX-License-Identifier: Apache-2.0
8+
*
9+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
10+
* not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
22+
#include "virtual_fs.h"
23+
24+
const char *board_id = "C006";
25+
26+
// Override default behavior
27+
//
28+
// URL_NAME and DRIVE_NAME must be 11 characters excluding
29+
// the null terminated character
30+
// Note - 4 byte alignemnt required as workaround for ARMCC compiler bug with weak references
31+
__attribute__((aligned(4)))
32+
const vfs_filename_t daplink_url_name = "VBLUNO51HTM";
33+
__attribute__((aligned(4)))
34+
const vfs_filename_t daplink_drive_name = "DAPLINK ";
35+
__attribute__((aligned(4)))
36+
const char *const daplink_target_url = "https://vngiotlab.github.io/vbluno/";

source/daplink/usb2uart/usbd_user_cdc_acm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ int32_t USBD_CDC_ACM_PortSetLineCoding(CDC_LINE_CODING *line_coding)
8585
UART_Config.DataBits = (UART_DataBits) line_coding->bDataBits;
8686
UART_Config.Parity = (UART_Parity) line_coding->bParityType;
8787
UART_Config.StopBits = (UART_StopBits) line_coding->bCharFormat;
88+
#if defined(BOARD_VBLUNO51) || defined(BOARD_VBLUNO52)
89+
UART_Config.FlowControl = UART_FLOW_CONTROL_RTS_CTS;
90+
#else
8891
UART_Config.FlowControl = UART_FLOW_CONTROL_NONE;
92+
#endif
93+
8994
return uart_set_configuration(&UART_Config);
9095
}
9196

test/info.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
('lpc11u35_nz32_sc151_if', False, 0x0000, "bin" ),
7171
('lpc11u35_wizwiki_w7500_if', False, 0x0000, "bin" ),
7272
('lpc11u35_wizwiki_w7500_eco_if', False, 0x0000, "bin" ),
73-
('lpc11u35_wizwiki_w7500p_if', False, 0x0000, "bin" ),
73+
('lpc11u35_wizwiki_w7500p_if', False, 0x0000, "bin" ),
74+
("lpc11u35_vbluno51_if", False, 0x0000, "bin" ),
7475
}
7576

7677
# All supported configurations
@@ -134,6 +135,7 @@
134135
( 0x2201, 'lpc11u35_wizwiki_w7500_if', None, 'WIZWIKI_W7500' ),
135136
( 0x2202, 'lpc11u35_wizwiki_w7500_eco_if', None, 'WIZWIKI_W7500ECO' ),
136137
( 0x2203, 'lpc11u35_wizwiki_w7500p_if', None, 'WIZWIKI_W7500P' ),
138+
( 0xC006, 'lpc11u35_vbluno51_if', None, 'VNG-VBLUno51' ),
137139
]
138140

139141
# Add new HICs here
@@ -179,7 +181,8 @@
179181
'Seeed-Tiny-BLE',
180182
'Seeed-Arch-Link',
181183
'SSCI-MBIT',
182-
'BlueNinja',]
184+
'BlueNinja',
185+
'VNG-VBLUno51',]
183186

184187
BOARD_ID_TO_BUILD_TARGET = {config[0]: config[3] for config in
185188
SUPPORTED_CONFIGURATIONS}

0 commit comments

Comments
 (0)