tux-evse / ti-am62x-m4-firmware Goto Github PK
View Code? Open in Web Editor NEWM4 firmware for Phytec Power board
License: Apache License 2.0
M4 firmware for Phytec Power board
License: Apache License 2.0
# Out of free firmware for Ti-am62x M4/MCU for Phytec power board ## Project: github.com/tux-evse/ti-am62x-m4-firmware This code interfaces Phytec power board on Ti-AM62x. It runs on Ti Soc/M4-MCU and exposes through rpmsg/virtio mechanism a set of protobuf messages to communicate with Linux. Linux ti-am62x-binding-rs companion is written in rust and is available from the same github project. This code is a fork/customization from Pionix demonstration Everest firmware for Phytec/Am62x. It only requirer Ti ARM-CGT-CLANG & MCU-PLUS-SDK-AM62X to be recompiled and compiles independently of Everest framework. ## Reference * Ti-tools AM62x/M4 X-chain: https://software-dl.ti.com/processor-sdk-linux/esd/AM64X/latest/exports/docs/linux/Foundational_Components_IPC64x.html * Linux firmware companion: https://github.com/Tux-Evse/ti-am62x-binding-rs.git * Pionix original code: https://github.com/PionixPublic/ti-am62x-evse-sdk.git ## Documentation * https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#TI_PRU_Code_Generation_Tools * https://github.com/MarkAYoder/PRUCookbook/blob/master/docs/03details/details.adoc * https://software-dl.ti.com/codegen/docs/tiarmclang/compiler_tools_user_guide/ ## Compilation ### Install Ti/Sitara SDK * Compiler: https://www.ti.com/tool/download/ARM-CGT-CLANG/3.2.0.LTS * Sysroot: https://www.ti.com/tool/SYSCONFIG#downloads * SDK: https://www.ti.com/tool/download/MCU-PLUS-SDK-AM62X/09.00.00.19 ### Check/Install missing dependencies * ldd ./ti-cgt-armllvm_3.2.0.LTS/bin/tiarmclang * zypper/apt install libncurses5 * Fedora sudo ln -sf /usr/lib64/libncurses.so.? /usr/lib64/libtinfo.so.5 ## SDK compilation ### Customize import.mak to match your installation path ```bash cat etc/import.mak HOME:=$(HOME)/Workspace/Tux-Evse/Ti CGT_GCC_ARM_PATH=$(HOME)/ti-cgt-armllvm_3.2.0.LTS DEVICE ?= am62x CGT_ARMLLVM_VERSION=3.2.0.LTS SYSCONFIG_VERSION=1.18 ``` ### Fix ClockP_deinit interface bug and build SDK Search for ClockP_deinit remove (ulong tic) to match with free-rtos public API. If you did not mess up ```make``` should build library and samples. ## Buiding out-of-tree ti-am62x-m4-firmware If you have installed Ti SDK within ../Ti as within following directory tree, then a simple make within sample directory should do the job ```bash tree -L2 .. ├── Ti │ ├── mcu_plus_sdk_am62x_09_00_00_19 │ ├── ti-sysconfig_1.18 │ ├── ti-cgt-armllvm_3.2.0.LTS ├── ti-am62x-binding-rs │ ├── afb-binding │ ├── Cargo.lock │ ├── Cargo.toml │ ├── Fulup-README │ └── ti-rpmsg ├── ti-am62x-m4-firmware │ ├── etc │ ├── Firmware │ ├── LICENSE │ ├── Makefile │ ├── README │ └── src ``` ```bash git clone [email protected]:tux-evse/ti-am62x-m4-firmware.git cd ti-am62x-m4-firmware && make scp Firmware/am62-mcu-m4f0_0-fw My-Board-IP:/usr/local/firmware ``` ## config your board check uboot on ```bash cat /sys/kernel/debug/remoteproc/remoteproc0/trace0 ``` ## installing sample firmware on your board !! Warning: following step may depend on your BSP OS configuration Check firmware is declared within your kernel ```bash cat /sys/class/remoteproc/remoteproc0/firmware ``` Place your firmware in the configured location ```bash scp Firmware/am62-mcu-m4f0_0-fw root@phytec-power:/usr/lib/firmware/ ssh root@phytec-power reboot ``` Connect with a terminal emulateur to M4 serial console ```bash # dev name may change, but tipically # - /dev/ttyUSB0 is the am62x Linux console # - /dev/ttyUSB1 is the M4 console picocom -b 115200 /dev/ttyUSB1 ``` Check debug buffer ring ```bash cat /sys/kernel/debug/remoteproc/remoteproc0/trace0 ``` Check firmware (stop non accepted) ```bash cat /sys/class/remoteproc/remoteproc0/firmware echo start >/sys/class/remoteproc/remoteproc0/state ``` Start ti-am62x binding ```bash cynagora-admin set '' 'HELLO' '' '*' yes # give access to devtools via TCP port /usr/bin/afb-binder -p 1234 -vvv --config /usr/redpesk/ti-am62x-binding-rs/etc/binding-ti-am62x.json ``` Connect with your brower on binding devtool debug interface (make phytec-power host match your config) http://phytec-power:1234/devtools ## WARNING: * send tiam62x/pwm=off to move CP from -12 to +12 * send tiam62x/iec6185=true to enable device protobuf firmware event push
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.