board config

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: board config

Post by Giovanni »

Hi Larry,

I/O mappings are described in the various STM32 datasheets, you should verify there for correct CAN settings. Board files are exactly the same for all F4s. Also verify if there are simple connection/electrical problems.

Giovanni
ljfischer
Posts: 19
Joined: Sat Jan 04, 2014 5:03 am

Re: board config

Post by ljfischer »

Thanks for the fast reply. So based on your comment, I should be able to leverage the discovery board files, for the M4, with the only issue being that the M4 has fewer pins? As long as I use common pins, I should be good? If thats the case, then the implication is that the problem is in my wiring?

TIA,
Larry
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: board config

Post by Giovanni »

What interface device are you using? I meant connection between MCU and that.

You can easily check if pins are programmed correctly by looking at signals with an oscilloscope.

Something else to check are clock settings, have both CANs the same baud rate?

About the board, verify that the pins you are trying to use are not connected to something else at board level.

Giovanni
ljfischer
Posts: 19
Joined: Sat Jan 04, 2014 5:03 am

Re: board config

Post by ljfischer »

Sorry for inadequate info. Im using max3051 transceivers. I put two of them in a breakout board, back to back, with a 120ohm resistor across Can H/L. Im pretty much using your testhal CAN sw. All boards use B8/B9 for talking to the transceivers. When I connect my two disco boards to the transceivers, all is fine, and the LEDs blink happily, indicating reception of frames. I have loopback disabled on all software, but beyond that, I havent changed the CAN config settings, and the settings are the same for both the discos and the M4. When I swap the M4, for one of the disco boards, I have no blinky lights. Again -using b8/b9 to talk to the Transceiver. If I put the m4 in loopback mode, it talks happily to itself, and I get blinky LEDs for both CAN xfaces.
ljfischer
Posts: 19
Joined: Sat Jan 04, 2014 5:03 am

Re: board config

Post by ljfischer »

And yes, using a scope to look at the signals coming out of the B8/B9 pins on the M4, they are not the same as those on the Disco. So clearly I have some kind of pin mapping issue.
ljfischer
Posts: 19
Joined: Sat Jan 04, 2014 5:03 am

Re: board config

Post by ljfischer »

OK - problem solved but that took a bit of work to decipher the mcuconfig, board.h, and Can timing relationships. I think there can be a doc for dummys, that one (maybe me) might publish on how to handle boards of different timing.
The Mini-m4 runs at 120mhz - not 168. I was confused by looking at CAN H/Lscope traces; they just look funny when the bit timing is way off, and I havent done enough CAN work to recognize it.
The short answer is that in order to run at ~500khz, the mini-m4 needs a prescalar of 4. And it just works.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: board config

Post by Giovanni »

Hi,

The manual for everything clock-related and, in general, everything you can see in mcuconf.h is the STM32 Reference Manual, settings and behavior are not defined by the HAL code, everything is named after something you can find in the RM.

A manual regarding the clock settings would be pretty much a duplicate of the RCC section of the RM.

Giovanni
neums
Posts: 137
Joined: Fri May 08, 2015 1:09 pm
Has thanked: 10 times
Been thanked: 5 times

Re: board config

Post by neums »

Hi,
is it possible to drag and drop a pin within a port in Design view in that way that the pin number changes automatically? For example if i drag the pin 4 and drop it before the pin 2 because i want to change the pin arrangement the pin numbering in the Design view does not change.
After dropping i have the order: 0, 1, 4, 2, 3, 5, 6, ... instead of 0, 1, 2, 3, 4, 5, 6, ....

It is also not possible to rename it manually in the Design view, just in Source view.
Attachments
Pin_config_order.png
Pin_config_order.png (6.01 KiB) Viewed 6826 times
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: board config

Post by Giovanni »

Hi,

That is the standard Eclipse XML editor, it knows nothing about pins, order is dictated by the XML schema.

You can edit the XML source, that is often a fast way to rearrange pins.

Giovanni
Post Reply