Re: STM32 CAN bus driver issues #stm32 #can


Rodrigo Peixoto <rodrigopex@...>
 

Josef,

The BOARD_ROOT works for me even with Stm32 boards. The pinmux is mandatory for alternate functions on st boards.

You can run the following commad to set the board root:

west build -b hvac_sensors -s. -- -DBOARD_ROOT=`pwd`

The code is considering your board is in the root directory following the structure boards/arm/hvac_sensors.

Done. Your board will run properly, I hope :)

At the dts, some configuration are applied to variables only and not affect the code at all. You'll need to use those variables on your code. If you want to check the dts generated variables, you can see the build/zephyr/include/generated/...

Good luck.
Best regards,
Rodrigo Peixoto

On Sat, 30 Mar 2019 at 11:37 Josef Raschen <josef@...> wrote:
Update: CAN bus is working now with my board. I had to move by board
config into the Zephyr tree, then pinmuxing seems to work. I still do
not know the root cause. My configuration (for CAN) was identical to the
one of the STM32F072B Discovery board in the Zephyr tree, but still
pinmuxing was not working - at least for pins PB8 and PB9 where my CAN
transceiver is connected to. Maybe I missed to set a variable for
out-of-tree board definitions, or maybe there is a bug in the build
scripts for out-of-tree builds. I thought that setting the BOARD_ROOT
variable for CMake should be sufficient. Also the CONFIG_* flags were
all set correctly, just my pinmuxing was ignored.

Anyway, I can live with having my board config in the Zephyr tree.

In case anybody is interested, I pushed everything to github:
https://github.com/JosefR/zephyr (board name: hvac_sensors)

Thank you for all your help,
Josef


On 30.03.19 12:13, Josef Raschen wrote:
> Hi,
>
> the driver is built into the kernel, but what I found out yesterday is,
> that the pinmuxing is not set up correctly. And the STM32 CAN controller
> will wait until it has received some bits before it leaves the init
> mode. So I think, when I fix that, it should work.
>
> Thanks,
> Josef
>
>
> On 30.03.19 04:03, Lawrence King wrote:
>> To me, the problem look more like you didn’t include the CAN bus
>> drivers when you built the kernel. Try running ‘make menuconfig’ and
>> turning on the CAN bus, then rebuilding.
>
>
>
>
>



--
Rodrigo Peixoto
Co-founder and Technical guru

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex

.

Join users@lists.zephyrproject.org to automatically receive all group messages.