I have tried so much as modifying Giovanni's source code (/os/hal/platforms/STM32/can_lld.[h|c]) to add specialized handler code for CAN2 and still no luck. My test also included modifying the /testhal/STM32F4xx/CAN example to make pairs of the four lights blink whenever messages are sent/received in loopback mode. Sadly only three of the lights work since the messages are not coming back on CAN2.
This is the only thing standing in the way from me moving from projects written using the STM32 libraries. Once I get this fixed, I'll be proudly adopting ChibiStudio/SPC5Studio for future development.
Suggestions?
Also, I modified /boards/ST_STM32F4_DISCOVERY/cfg/board.chcfg as shown below:
Code: Select all
diff --git a/boards/ST_STM32F4_DISCOVERY/cfg/board.chcfg b/boards/ST_STM32F4_DISCOVERY/cfg/board.chcfg
index 68d30e2..18c985f 100644
--- a/boards/ST_STM32F4_DISCOVERY/cfg/board.chcfg
+++ b/boards/ST_STM32F4_DISCOVERY/cfg/board.chcfg
@@ -240,21 +240,21 @@
Mode="Input"
Alternate="0" />
<pin12
- ID=""
+ ID="CAN2_RX"
Type="PushPull"
Level="High"
Speed="Maximum"
Resistor="PullUp"
- Mode="Input"
- Alternate="0" />
+ Mode="Alternate"
+ Alternate="9" />
<pin13
- ID=""
+ ID="CAN2_TX"
Type="PushPull"
Level="High"
Speed="Maximum"
Resistor="PullUp"
- Mode="Input"
- Alternate="0" />
+ Mode="Alternate"
+ Alternate="9" />
<pin14
ID=""
Type="PushPull"
@@ -404,21 +404,21 @@
</GPIOC>
<GPIOD>
<pin0
- ID=""
+ ID="CAN1_RX"
Type="PushPull"
Level="High"
Speed="Maximum"
Resistor="PullUp"
- Mode="Input"
- Alternate="0" />
+ Mode="Alternate"
+ Alternate="9" ></pin0>
<pin1
- ID=""
+ ID="CAN1_TX"
Type="PushPull"
Level="High"
Speed="Maximum"
Resistor="PullUp"
- Mode="Input"
- Alternate="0" />
+ Mode="Alternate"
+ Alternate="9" ></pin1>
<pin2
ID=""
Type="PushPull"