2019/5/29

"echo -e" in make

在 build yocto 時遇到..
NOTE: make -j 6 DESTDIR=/home/charles-chang/psdk-auto/yocto-layers/
build/arago-tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/input-utils/1.0-r0/image STRIP=
| 
| Make.config written, edit if needed
| 
| Make.config:1: *** empty variable name.  Stop.
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
找一下 產生的 Make.config,內容是..
-e LIB := gcc
但是在 ubuntu 14.04 中又沒有問題,他的 Make.config 是
LIB := gcc
然後 這一篇 說...
I fixed this problem while building on Ubuntu 16.04 by modifying the input-utils Autoconf.mk. 
If you look at the failing Make.config, it had something like this:

-e LIB := gcc

Make.config is generated by mk/Autoconf.mk, which has the following:

Make.config: $(srcdir)/GNUmakefile
    @echo -e "$(make-config-q)" > $@
    @echo
    @echo "Make.config written, edit if needed"
    @echo
I removed the "-e". I didn't investigate why the echo invoked from the makefile would interpret 
the -e as something to output.
然後這一篇 說,印不印出 '-e' 是 shell 的關係。...
因為makefile中也有一個"$SHELL"的變數,跟系統的"$SHELL"變數互不干擾。

所以如果只有單一個makefile要使用bash的話,只要在makefile前面寫上"SHELL=/bin/bash"就可以完美執行囉~


因為 yocto 部份要改 source 並且 做version control 比較麻煩,所以改 system..
$sudo dpkg-reconfigure dash
然後選 No, 他就會改用bash..
Removing 'diversion of /bin/sh to /bin/sh.distrib by dash'
Adding 'diversion of /bin/sh to /bin/sh.distrib by bash'
Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash'
Adding 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by bash'

2019/5/28

bitbake link chromium failed with signal-9

ref:linux-c-linker-ld-terminated-with-signal-9
bitbake 在 build "chromium-wayland-53.0.2785.143-r0 do_compile()" 時fail, log 是 signal-9

竟然是因為記憶體不夠!!
這一篇說,要 link chronium,最好準備10G 的 free 實體記憶體。

另外參考這一篇,把 cach free 掉..
sudo echo 3 | sudo tee /proc/sys/vm/drop_caches
用 free -m 比較command 前後,free 由 6G 增加到 12G

2019/5/16

STM32 Power Mode.

from : https://www.st.com/content/ccc/resource/technical/document/application_note/27/58/8e/81/79/fb/4f/ac/DM00108286.pdf/files/DM00108286.pdf/jcr:content/translations/en.DM00108286.pdf


standby mode 等於是 reboot,因為 RAM 也沒電了。

stm32 timebase, SYS.

'When FreeRTOS is used, it is strongly recommended to use a HAL timebase source other than the systick.'
-- The HAL timebase source can be changed from the Pinout tab under SYS

到 Pinout tab 的 SYS,果然有 Timebase Source 可以選:
  • SysTick
  • TIM2
  • TIM3
  • TIM6
  • TIM7
  • TIM21
  • TIM22

2019/5/2

STM32L0538-DISCO Sample code for linux

github:https://github.com/checko/STM32Cube_FW_L0_V1.10.0.git branch : forlinux

就是 ST 網站的 demo code,但是他是給 Windows 用的。
所以要在 linux 打開的話,TrueStudio Project (.cproject)裡的 include path 都要改成 unux 的右斜線格式。

github 目前有改的是 Examples/GPIO/GPIO_EXIT 這個 project
其他 Example, Application 會在有用到的時候會持續 update (看 commit log)

.cproject 中的 Compile Setting -- Directory -- Include Path 相對路徑是基於 TrueStudion 的 .cproject 所在目錄下的 Debug 目錄。
-- 所以看起來會多一層。

.. 還要看一下Example 怎麼引入 Driver Folder 的 source code (link option ?)