2020-05-21 01:29 PM
Hi. I have generated a full device tree for the EV1 to add I2C5 pins PA11/PA12 for external connector hookup to some of my I2C widgets using STM32CubeMX. I've place the generated .dts file from the kernel/ folder into <linux-source>/arch/arm/boot/dts.
I am now following the Wiki at
https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package
in section 5.3.
. . .
PC $> pushd $WORKDIR/kernel/kernel-sources
(ok)
PC $> make O="$PWD/../build" multi_v7_defconfig
(ok)
PC $> for f in `ls -1 ../../sources/arm-openstlinux_weston-linux-gnueabi/linux-stm32mp-4.19-r0/fragment*.config`; do scripts/kconfig/merge_config.sh -m -r -O $PWD/../build $PWD/../build/.config $f; done
(ok)
PC $> make oldconfig O="$PWD/../build"
(STOP)
PROBLEM. The config script starts asking all of its unknown Y/n | y/N questions to which I have absolutely NO CLUE how to answer.
Please advise regarding how to proceed to get a correct build.
. . .
(not done):
PC $> make stm32mp157c-mydevicetree-mx.dtb LOADADDR=0xC2000040 O="$PWD/../build"
PC $> popd
PC $> ls -l $WORKDIR/kernel/build/arch/arm/boot/dts/stm32mp157c-mydevicetree-mx.dtb
(BTW I have rebuilt and reloaded this kernel more than once onto the EV1 without breaking anything so this is totally new behavior I'm seeing).
Thank you.
Solved! Go to Solution.
2020-05-22 02:59 AM
Hi @ThePUP
Regarding the YES question see GitHub readme: https://github.com/STMicroelectronics/meta-st-stm32mp/blob/thud/recipes-kernel/linux/linux-stm32mp/README.HOW_TO.txt chapter 5
yes '' | make ARCH=arm oldconfig O="$PWD/../build"
Hope this helps
Milan
2020-05-22 02:45 AM
Hi @ThePUP ,
Please see first https://wiki.st.com/stm32mpu/wiki/I2C_device_tree_configuration
Note that "The STM32CubeMX may not support all the properties described" (chapter 4) and must be set manually.
If still not working, send your dts file.
Best reagrds,
Milan
2020-05-22 02:59 AM
Hi @ThePUP
Regarding the YES question see GitHub readme: https://github.com/STMicroelectronics/meta-st-stm32mp/blob/thud/recipes-kernel/linux/linux-stm32mp/README.HOW_TO.txt chapter 5
yes '' | make ARCH=arm oldconfig O="$PWD/../build"
Hope this helps
Milan
2020-05-22 09:31 AM
using yes '' | make oldconfig ... does allow the build to continue and complete, even thought I'm not sure ALL the new configurations are really applicable. At any rate, here I am:
BUT
SO
I am attaching my cube-mx generated .dts source per your previous suggestion.
Thanks for the help (this is my first time through a DTB from scratch).
2020-05-22 11:09 AM
SOLVED (I believe)
I think my previous post was not needed because in fact my cube-mx generated .dts ==> kernel /boot/.dtb process was working in the first place. Thanks again for your suggestions on compilation, those helped.
With the ev1 distribution DTB loaded I get only /dev/i2c0 and /dev/i2c2.
With MY DTB loaded I get and additional /dev/i2c1. I don't know why I didn't see this earlier.
Below is screen dump from terminal showing that I can at least get address ACK from one of my devices now wired to I2C_EXT connector!
Very pleasant result for a Friday ...
root@stm32mp1:~# i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@stm32mp1:~# i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
40: -- -- UU -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- UU -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@stm32mp1:~# i2cdetect -y 1 <-- /dev/i2c1 in linux (shows up w/ my DTB)
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- 19 -- -- -- -- -- -- <-- this IS my device's address
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@stm32mp1:~# ls
Thanks again.
-pete