Skip to content

Commit 22f3bc4

Browse files
authored
Merge pull request #12436 from mprse/fpga_remove_gpio_pinmaps
Remove GPIO pin-maps used for FPGA testing
2 parents 9ec6f5d + 32311b7 commit 22f3bc4

File tree

7 files changed

+94
-163
lines changed

7 files changed

+94
-163
lines changed

TESTS/mbed_hal/pinmap/main.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
using namespace utest::v1;
2323

24-
#include "gpio_api.h"
25-
#include "gpio_irq_api.h"
2624
#include "analogin_api.h"
2725
#include "analogout_api.h"
2826
#include "can_api.h"
@@ -41,10 +39,6 @@ typedef struct {
4139
} pinmap_info_t;
4240

4341
const pinmap_info_t pinmap_functions[] = {
44-
PINMAP_TEST_ENTRY(gpio_pinmap),
45-
#if DEVICE_INTERRUPTIN
46-
PINMAP_TEST_ENTRY(gpio_irq_pinmap),
47-
#endif
4842
#if DEVICE_ANALOGIN
4943
PINMAP_TEST_ENTRY(analogin_pinmap),
5044
#endif

TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@
2828
#include "greentea-client/test_env.h"
2929
#include "platform/mbed_critical.h"
3030
#include <stdlib.h>
31+
#include "hal/serial_api.h"
3132
#include "UARTTester.h"
3233
#include "pinmap.h"
3334
#include "test_utils.h"
34-
#include "serial_api.h"
3535
#include "us_ticker_api.h"
3636
#include "uart_fpga_test.h"
3737
#include "hal/static_pinmap.h"
3838

39+
3940
using namespace utest::v1;
4041

4142
#define PUTC_REPS 16

components/testing/COMPONENT_FPGA_CI_TEST_SHIELD/test_utils.h

+13-9
Original file line numberDiff line numberDiff line change
@@ -111,26 +111,30 @@ void find_ports(std::list<PortType> &matched_ports, std::list<PortType> &not_mat
111111
const char *pin_type = PortType::PinMap::pin_type_names[i];
112112

113113
// Loop through each pin of a given type
114-
for (; map->pin != NC; map++) {
114+
for (uint32_t j = 0; j < FormFactorType::pins()->count; j++) {
115115
PortType port;
116-
// Set pin being tested
117-
port.pins[i] = map->pin;
118-
port.peripheral = map->peripheral;
119-
// Only form factor pins can be tested
120-
if (!pinmap_list_has_pin(FormFactorType::pins(), port.pins[i])) {
116+
117+
if (FormFactorType::pins()->pins[j] == NC) {
118+
utest_printf("Skipping (NC pin) %s pin %s (%i)\r\n", pin_type,
119+
FormFactorType::pin_to_string(port.pins[i]), port.pins[i]);
121120
continue;
122121
}
122+
123+
// Set pin being tested
124+
port.pins[i] = FormFactorType::pins()->pins[j];
125+
port.peripheral = pinmap_find_peripheral(port.pins[i], map);
126+
123127
// Don't test restricted pins
124128
if (pinmap_list_has_pin(FormFactorType::restricted_pins(), port.pins[i])) {
125-
utest_printf("Skipping %s pin %s (%i)\r\n", pin_type,
129+
utest_printf("Skipping (restricted pin) %s pin %s (%i)\r\n", pin_type,
126130
FormFactorType::pin_to_string(port.pins[i]), port.pins[i]);
127131
continue;
128132
}
129133

130134
if (!strcmp(PortType::PinMap::name, GPIO_IRQ_NAME) || !strcmp(PortType::PinMap::name, GPIO_NAME)) {
131135
// Don't test restricted gpio pins
132136
if (pinmap_list_has_pin(pinmap_gpio_restricted_pins(), port.pins[i])) {
133-
utest_printf("Skipping %s pin %s (%i)\r\n", pin_type,
137+
utest_printf("Skipping (restricted gpio pin) %s pin %s (%i)\r\n", pin_type,
134138
FormFactorType::pin_to_string(port.pins[i]), port.pins[i]);
135139
continue;
136140
}
@@ -139,7 +143,7 @@ void find_ports(std::list<PortType> &matched_ports, std::list<PortType> &not_mat
139143
#if DEVICE_SERIAL
140144
if (!strcmp(PortType::PinMap::name, UART_NAME) || !strcmp(PortType::PinMap::name, UARTNOFC_NAME)) {
141145
if (pinmap_list_has_peripheral(pinmap_uart_restricted_peripherals(), port.peripheral)) {
142-
utest_printf("Skipping %s peripheral %i with pin %s (%i)\r\n", pin_type,
146+
utest_printf("Skipping (restricted uart peripheral) %s peripheral %i with pin %s (%i)\r\n", pin_type,
143147
port.peripheral, FormFactorType::pin_to_string(port.pins[i]), port.pins[i]);
144148
continue;
145149
}

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW24D/TARGET_FRDM/PeripheralPins.c

+13-54
Original file line numberDiff line numberDiff line change
@@ -16,47 +16,6 @@
1616

1717
#include "PeripheralPins.h"
1818

19-
/************GPIO***************/
20-
const PinMap PinMap_GPIO[] = {
21-
{PTA0, GPIO_X, 1},
22-
{PTA1, GPIO_X, 1},
23-
{PTA2, GPIO_X, 1},
24-
{PTA3, GPIO_X, 1},
25-
{PTA4, GPIO_X, 1},
26-
{PTA18, GPIO_X, 1},
27-
{PTA19, GPIO_X, 1},
28-
29-
{PTC4, GPIO_X, 1},
30-
{PTC5, GPIO_X, 1},
31-
{PTC6, GPIO_X, 1},
32-
{PTC7, GPIO_X, 1},
33-
34-
{PTD1, GPIO_X, 1},
35-
{PTD2, GPIO_X, 1},
36-
{PTD3, GPIO_X, 1},
37-
{PTD4, GPIO_X, 1},
38-
{PTD5, GPIO_X, 1},
39-
{PTD6, GPIO_X, 1},
40-
{PTD7, GPIO_X, 1},
41-
42-
{PTE0, GPIO_X, 1},
43-
{PTE1, GPIO_X, 1},
44-
{PTE2, GPIO_X, 1},
45-
{PTE3, GPIO_X, 1},
46-
{PTE4, GPIO_X, 1},
47-
{PTE16, GPIO_X, 1},
48-
{PTE17, GPIO_X, 1},
49-
{PTE18, GPIO_X, 1},
50-
{PTE19, GPIO_X, 1},
51-
52-
{NC , NC , 0}
53-
};
54-
55-
const PinMap *gpio_pinmap()
56-
{
57-
return PinMap_GPIO;
58-
}
59-
6019
/************RTC***************/
6120
const PinMap PinMap_RTC[] = {
6221
{NC, OSC32KCLK, 0},
@@ -75,22 +34,22 @@ const PinMap PinMap_ADC[] = {
7534
{PTE17, ADC0_SE5a, 0},
7635
{PTE18, ADC0_SE6a, 0},
7736
{PTE19, ADC0_SE7a, 0},
78-
{NC , NC , 0}
37+
{NC, NC, 0}
7938
};
8039

8140
/************I2C***************/
8241
const PinMap PinMap_I2C_SDA[] = {
8342
{PTD3, I2C_0, 4},
8443
{PTE0, I2C_1, 6},
8544
{PTE18, I2C_0, 4},
86-
{NC , NC , 0}
45+
{NC, NC, 0}
8746
};
8847

8948
const PinMap PinMap_I2C_SCL[] = {
9049
{PTD2, I2C_0, 4},
9150
{PTE1, I2C_1, 6},
9251
{PTE19, I2C_0, 4},
93-
{NC , NC , 0}
52+
{NC, NC, 0}
9453
};
9554

9655
/************UART***************/
@@ -101,7 +60,7 @@ const PinMap PinMap_UART_TX[] = {
10160
{PTE0, UART_1, 3},
10261
{PTD3, UART_2, 3},
10362
{PTE16, UART_2, 3},
104-
{NC , NC , 0}
63+
{NC, NC, 0}
10564
};
10665

10766
const PinMap PinMap_UART_RX[] = {
@@ -111,7 +70,7 @@ const PinMap PinMap_UART_RX[] = {
11170
{PTD2, UART_2, 3},
11271
{PTE17, UART_2, 3},
11372

114-
{NC , NC , 0}
73+
{NC, NC, 0}
11574
};
11675

11776
const PinMap PinMap_UART_CTS[] = {
@@ -120,15 +79,15 @@ const PinMap PinMap_UART_CTS[] = {
12079
{PTE2, UART_1, 3},
12180
{PTE18, UART_2, 3},
12281
{PTA0, UART_0, 2},
123-
{NC , NC , 0}
82+
{NC, NC, 0}
12483
};
12584

12685
const PinMap PinMap_UART_RTS[] = {
12786
{PTD4, UART_0, 3},
128-
{PTE3 , UART_1, 3},
87+
{PTE3, UART_1, 3},
12988
{PTE19, UART_2, 3},
13089
{PTA3, UART_0, 2},
131-
{NC , NC , 0}
90+
{NC, NC, 0}
13291
};
13392

13493
/************SPI***************/
@@ -138,7 +97,7 @@ const PinMap PinMap_SPI_SCLK[] = {
13897
{PTD1, SPI_0, 2},
13998
{PTE2, SPI_1, 2},
14099
{PTE17, SPI_0, 2},
141-
{NC , NC , 0}
100+
{NC, NC, 0}
142101
};
143102

144103
const PinMap PinMap_SPI_MOSI[] = {
@@ -148,7 +107,7 @@ const PinMap PinMap_SPI_MOSI[] = {
148107
{PTE1, SPI_1, 2},
149108
{PTE3, SPI_1, 7},
150109
{PTE18, SPI_0, 2},
151-
{NC , NC , 0}
110+
{NC, NC, 0}
152111
};
153112

154113
const PinMap PinMap_SPI_MISO[] = {
@@ -158,15 +117,15 @@ const PinMap PinMap_SPI_MISO[] = {
158117
{PTE1, SPI_1, 7},
159118
{PTE3, SPI_1, 2},
160119
{PTE19, SPI_0, 2},
161-
{NC , NC , 0}
120+
{NC, NC, 0}
162121
};
163122

164123
const PinMap PinMap_SPI_SSEL[] = {
165124
{PTB10, SPI_1, 2},
166125
{PTC4, SPI_0, 2},
167126
{PTE4, SPI_1, 2},
168127
{PTE16, SPI_0, 2},
169-
{NC , NC , 0}
128+
{NC, NC, 0}
170129
};
171130

172131
/************PWM***************/
@@ -181,5 +140,5 @@ const PinMap PinMap_PWM[] = {
181140
{PTA2, PWM_7, 3},
182141
{PTA3, PWM_0, 3},
183142
{PTA4, PWM_1, 3},
184-
{NC , NC , 0}
143+
{NC, NC, 0}
185144
};

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/TARGET_FRDM/PeripheralPins.c

+12-51
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,6 @@
1616

1717
#include "PeripheralPins.h"
1818

19-
/************GPIO***************/
20-
const PinMap PinMap_GPIO[] = {
21-
{PTA0, GPIO_X, 1},
22-
{PTA1, GPIO_X, 1},
23-
{PTA2, GPIO_X, 1},
24-
{PTA16, GPIO_X, 1},
25-
{PTA17, GPIO_X, 1},
26-
{PTA18, GPIO_X, 1},
27-
{PTA19, GPIO_X, 1},
28-
29-
{PTB0, GPIO_X, 1},
30-
{PTB1, GPIO_X, 1},
31-
{PTB2, GPIO_X, 1},
32-
{PTB3, GPIO_X, 1},
33-
{PTB16, GPIO_X, 1},
34-
{PTB17, GPIO_X, 1},
35-
{PTB18, GPIO_X, 1},
36-
37-
// {PTC0, GPIO_X, 1}, // PTC0 is not available on the 48-pin Laminate QFN package.
38-
{PTC1, GPIO_X, 1},
39-
{PTC2, GPIO_X, 1},
40-
{PTC3, GPIO_X, 1},
41-
{PTC4, GPIO_X, 1},
42-
{PTC5, GPIO_X, 1},
43-
{PTC6, GPIO_X, 1},
44-
{PTC7, GPIO_X, 1},
45-
{PTC16, GPIO_X, 1},
46-
{PTC17, GPIO_X, 1},
47-
{PTC18, GPIO_X, 1},
48-
{PTC19, GPIO_X, 1},
49-
50-
{NC , NC , 0}
51-
};
52-
53-
const PinMap *gpio_pinmap()
54-
{
55-
return PinMap_GPIO;
56-
}
57-
5819
/************RTC***************/
5920
const PinMap PinMap_RTC[] = {
6021
{NC, OSC32KCLK, 0},
@@ -67,7 +28,7 @@ const PinMap PinMap_ADC[] = {
6728
{PTB2, ADC0_SE3, 0},
6829
{PTB18, ADC0_SE4, 0},
6930
{PTA19, ADC0_SE5, 0},
70-
{NC , NC , 0}
31+
{NC, NC, 0}
7132
};
7233

7334
/************DAC***************/
@@ -85,7 +46,7 @@ const PinMap PinMap_I2C_SDA[] = {
8546
{PTC7, I2C_1, 3},
8647
{PTC16, I2C_0, 3},
8748
{PTC18, I2C_1, 3},
88-
{NC , NC , 0}
49+
{NC, NC, 0}
8950
};
9051

9152
const PinMap PinMap_I2C_SCL[] = {
@@ -96,61 +57,61 @@ const PinMap PinMap_I2C_SCL[] = {
9657
{PTC6, I2C_1, 3},
9758
{PTC17, I2C_1, 3},
9859
{PTC19, I2C_0, 3},
99-
{NC , NC , 0}
60+
{NC, NC, 0}
10061
};
10162

10263
/************UART***************/
10364
const PinMap PinMap_UART_TX[] = {
10465
{PTC3, LPUART_0, 4},
10566
{PTC7, LPUART_0, 4},
10667
{PTC18, LPUART_0, 4},
107-
{NC , NC , 0}
68+
{NC, NC, 0}
10869
};
10970

11071
const PinMap PinMap_UART_RX[] = {
11172
{PTC2, LPUART_0, 4},
11273
{PTC6, LPUART_0, 4},
11374
{PTC17, LPUART_0, 4},
114-
{NC , NC , 0}
75+
{NC, NC, 0}
11576
};
11677

11778
const PinMap PinMap_UART_CTS[] = {
11879
{PTC4, LPUART_0, 4},
11980
{PTC19, LPUART_0, 4},
120-
{NC , NC , 0}
81+
{NC, NC, 0}
12182
};
12283

12384
const PinMap PinMap_UART_RTS[] = {
12485
{PTC1, LPUART_0, 4},
12586
{PTC5, LPUART_0, 4},
12687
{PTC16, LPUART_0, 4},
127-
{NC , NC , 0}
88+
{NC, NC, 0}
12889
};
12990

13091
/************SPI***************/
13192
const PinMap PinMap_SPI_SCLK[] = {
13293
{PTA18, SPI_1, 2},
13394
{PTC16, SPI_0, 2},
134-
{NC , NC , 0}
95+
{NC, NC, 0}
13596
};
13697

13798
const PinMap PinMap_SPI_MOSI[] = {
13899
{PTA16, SPI_1, 2},
139100
{PTC17, SPI_0, 2},
140-
{NC , NC , 0}
101+
{NC, NC, 0}
141102
};
142103

143104
const PinMap PinMap_SPI_MISO[] = {
144105
{PTA17, SPI_1, 2},
145106
{PTC18, SPI_0, 2},
146-
{NC , NC , 0}
107+
{NC, NC, 0}
147108
};
148109

149110
const PinMap PinMap_SPI_SSEL[] = {
150111
{PTA1, SPI_1, 2},
151112
{PTA19, SPI_1, 2},
152113
{PTC19, SPI_0, 2},
153-
{NC , NC , 0}
114+
{NC, NC, 0}
154115
};
155116

156117
/************PWM***************/
@@ -171,5 +132,5 @@ const PinMap PinMap_PWM[] = {
171132
{PTB3, PWM_6, 5},
172133
{PTC4, PWM_5, 5},
173134
{PTC5, PWM_6, 5},
174-
{NC , NC , 0}
135+
{NC, NC, 0}
175136
};

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/TARGET_FRDM/PeripheralPinMaps.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ MSTD_CONSTEXPR_OBJ_11 PinMap PinMap_I2C_SDA[] = {
6767
{PTB3, I2C_0, 2},
6868
{PTC11, I2C_1, 2},
6969
{PTA13, I2C_2, 5},
70-
{PTD3, I2C_0, 7},
70+
// {PTD3, I2C_0, 7}, // Fails FPGA testing
7171
{PTE0, I2C_1, 6},
7272
{NC, NC, 0}
7373
};

0 commit comments

Comments
 (0)