Skip to content

Commit ce78144

Browse files
committed
[DISCO_F469NI] Added CAN support
Added CAN API support for DISCO_F469NI target. Change-Id: Icfc52ec532aa71412814f245b41494fa69df4430
1 parent 96787cd commit ce78144

File tree

8 files changed

+35
-5
lines changed

8 files changed

+35
-5
lines changed

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F469NI/PeripheralNames.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ typedef enum {
9191
PWM_14 = (int)TIM14_BASE
9292
} PWMName;
9393

94+
typedef enum {
95+
CAN_1 = (int)CAN1_BASE,
96+
CAN_2 = (int)CAN2_BASE
97+
} CANName;
98+
9499
#ifdef __cplusplus
95100
}
96101
#endif

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F469NI/PeripheralPins.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,13 @@ const PinMap PinMap_SPI_SSEL[] = {
301301
{PI_0, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
302302
{NC, NC, 0}
303303
};
304+
305+
const PinMap PinMap_CAN_RD[] = {
306+
{PB_8 , CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
307+
{NC, NC, 0}
308+
};
309+
310+
const PinMap PinMap_CAN_TD[] = {
311+
{PB_9 , CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
312+
{NC, NC, 0}
313+
};

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F469NI/device.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454

5555
#define DEVICE_SLEEP 1
5656

57+
#define DEVICE_CAN 1
58+
5759
//=======================================
5860

5961
#define DEVICE_SEMIHOST 0

hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F469NI/objects.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ struct pwmout_s {
104104
uint8_t inverted;
105105
};
106106

107+
struct can_s {
108+
CANName can;
109+
int index;
110+
};
111+
107112
#include "gpio_object.h"
108113

109114
#ifdef __cplusplus

libraries/tests/mbed/can/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ CAN can1(PD_0, PD_1);
1919
defined(TARGET_NUCLEO_F303RE) || defined(TARGET_NUCLEO_F303K8) || \
2020
defined(TARGET_NUCLEO_F302R8) || defined(TARGET_NUCLEO_F446RE)
2121
CAN can1(PA_11, PA_12);
22+
#elif defined(TARGET_DISCO_F469NI)
23+
CAN can1(PB_8, PB_9);
2224
#else
2325
CAN can1(p9, p10);
2426
#endif
@@ -27,7 +29,7 @@ CAN can1(p9, p10);
2729
CAN can2(p34, p33);
2830
#elif defined (TARGET_LPC1768)
2931
CAN can2(p30, p29);
30-
#elif defined(TARGET_NUCLEO_F446RE)
32+
#elif defined(TARGET_NUCLEO_F446RE) || defined(TARGET_DISCO_F469NI)
3133
CAN can2(PB_5, PB_6);
3234
#endif
3335
char counter = 0;

libraries/tests/mbed/can_interrupt/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ CAN can1(PD_0, PD_1);
1919
defined(TARGET_NUCLEO_F303RE) || defined(TARGET_NUCLEO_F303K8) || \
2020
defined(TARGET_NUCLEO_F302R8) || defined(TARGET_NUCLEO_F446RE)
2121
CAN can1(PA_11, PA_12);
22+
#elif defined(TARGET_DISCO_F469NI)
23+
CAN can1(PB_8, PB_9);
2224
#else
2325
CAN can1(p9, p10);
2426
#endif
@@ -27,7 +29,7 @@ CAN can1(p9, p10);
2729
CAN can2(p34, p33);
2830
#elif defined (TARGET_LPC1768)
2931
CAN can2(p30, p29);
30-
#elif defined(TARGET_NUCLEO_F446RE)
32+
#elif defined(TARGET_NUCLEO_F446RE) || defined(TARGET_DISCO_F469NI)
3133
CAN can2(PB_5, PB_6);
3234
#endif
3335
char counter = 0;

libraries/tests/mbed/can_loopback/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ CAN can1(P5_9, P5_10);
1818
defined(TARGET_NUCLEO_F303RE) || defined(TARGET_NUCLEO_F303K8) || \
1919
defined(TARGET_NUCLEO_F302R8) || defined(TARGET_NUCLEO_F446RE)
2020
CAN can1(PA_11, PA_12);
21+
#elif defined(TARGET_DISCO_F469NI)
22+
CAN can1(PB_8, PB_9);
2123
#endif
2224

2325
#define TEST_ITERATIONS 127

workspace_tools/tests.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
* NUCLEO_F303K8: (RX=PA_11, TX=PA_12)
100100
* NUCLEO_F302R8: (RX=PA_11, TX=PA_12)
101101
* NUCLEO_F446RE: (RX=PA_11, TX=PA_12)
102+
* DISCO_F469NI: (RX=PB_8, TX=PB_9)
102103
103104
"""
104105
TESTS = [
@@ -306,7 +307,8 @@
306307
"peripherals": ["can_transceiver"],
307308
"mcu": ["LPC1549", "LPC1768","B96B_F446VE", "VK_RZ_A1H",
308309
"NUCLEO_F091RC", "NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8",
309-
"NUCLEO_F303RE", "NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE"],
310+
"NUCLEO_F303RE", "NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE",
311+
"DISCO_F469NI"],
310312
},
311313
{
312314
"id": "MBED_BLINKY", "description": "Blinky",
@@ -579,15 +581,15 @@
579581
"dependencies": [MBED_LIBRARIES],
580582
"mcu": ["LPC1768", "LPC4088", "LPC1549", "RZ_A1H", "B96B_F446VE", "NUCLEO_F091RC",
581583
"NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8", "NUCLEO_F303RE",
582-
"NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE"]
584+
"NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE", "DISCO_F469NI"]
583585
},
584586
{
585587
"id": "MBED_30", "description": "CAN network test using interrupts",
586588
"source_dir": join(TEST_DIR, "mbed", "can_interrupt"),
587589
"dependencies": [MBED_LIBRARIES],
588590
"mcu": ["LPC1768", "LPC4088", "LPC1549", "RZ_A1H", "B96B_F446VE", "NUCLEO_F091RC",
589591
"NUCLEO_F072RB", "NUCLEO_F042K6", "NUCLEO_F334R8", "NUCLEO_F303RE",
590-
"NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE"]
592+
"NUCLEO_F303K8", "NUCLEO_F302R8", "NUCLEO_F446RE", "DISCO_F469NI"]
591593
},
592594
{
593595
"id": "MBED_31", "description": "PWM LED test",

0 commit comments

Comments
 (0)