Age | Commit message (Collapse) | Author |
|
The uart_polling and uart_interrupt examples were originally written for a UART used in DCE mode. The Colibri iMX7 is designed to use the UART in DTE mode. The signals are swapped between DTE and DCE (Rx <-> Tx, and control signals).
In order to use the correct pin direction, the bit DCEDTE in the UARTx_UFCR register needs to be configured accordingly.
Signed-off-by: Andy Kiser <andy.kiser@gmx.ch>
|
|
Currently we use -O0 (no optimization) for debug builds. Unfortunately
this leads to large firmwares really quickly, and prevents debugging
in TCM/OCRAM. Use -Og which enables some optimization which do not
interfere with debugging. GCC manual says:
Optimize debugging experience. -Og enables optimizations that do not
interfere with debugging. It should be the optimization level of choice
for the standard edit-compile-debug cycle, offering a reasonable level
of optimization while maintaining fast compilation and a good debugging
experience.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Since the use of a elf binary is anyway required, we can place
sections freely in memory. Therefor it is not necessary to store
the variable initialization section (.data) after the code (.text)
section and copy it in the firmwares startup code. Instead, just
let the elf loader load the .data section directly to its final
place. With that the program header look like this:
Program Header:
LOAD off 0x00001000 vaddr 0x00000000 paddr 0x00000000 align 2**12
filesz 0x00000240 memsz 0x00000240 flags r--
LOAD off 0x00002000 vaddr 0x1fff8000 paddr 0x1fff8000 align 2**12
filesz 0x00006534 memsz 0x00006534 flags rwx
LOAD off 0x00009000 vaddr 0x20000000 paddr 0x20000000 align 2**12
filesz 0x000001d0 memsz 0x00005dc8 flags rw-
Note the additional program header which loads the .data section
directly to the data region at 0x20000000.
This safes space in the code region and slightly improves the
startup time since the copy loop is not required.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Make sure the correct alternate mode is choosen and RX pin daisy
chaining is taken care of.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Use FlexCAN instance 1 with pinmux ENET1_RD2/ENET1_RD3 as CAN RX/TX.
This pads are available at SODIMM 63/55 and are compatible with
Colibri iMX6/VFxx.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Not all example provide a gpio_ctrl.h header file. Do not include
it from the base gpio_ctrl.h header file.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
This example control two leds and two buttons and also communicates
between M4 and A7 using rpmsg.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
This example control a led and a button just using GPIOs from
the bank 2 (GPIO2).
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
According to the configuration I will use in the webinar, I add this config
files to better exaplain gpio usage
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Use explicit pointer to struct rpmsg_hdr_reserved to avoid warnings:
rpmsg_ext.c:160:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
((struct rpmsg_hdr_reserved*)&hdr->reserved)->idx = idx;
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Configure RDC memory mapping when running firmware from DDR.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Add symbols which define the DDR memory area. This is useful to
setup the RDC memory region mapping.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Add helper macros which allow to align memory for RDC memory
region mappings.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Also changed the linker to OCRAM.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Also changed the linker to OCRAM and remove no-strict-aliasing.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration
at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Updating this CMake struct according hello_world example.
Using this new struct we can build debug and release configuration at the same time and use Eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Adding Eclipse CDT4 Generator in orther to have the .cproject .project created with cmake command.
It help to include the files inside eclipse.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
[add generated Eclipse file to gitignore]
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
GCC 5 and newer seem to choose higher alignment values in elf program
headers than older versions. This causes issues when doing address
translations with areas which have lower alignment: It moves the base
address outside of memory base addresse (e.g. TCML memory base address
is aligned to 32kiB).
With 4K we use a safe and sensible value for alignment. With that all
elf program headers are aligned with 0x1000.
$ readelf -l debug/hello_world.elf
Elf file type is EXEC (Executable file)
Entry point 0x1fff8311
There are 3 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x001000 0x1fff8000 0x1fff8000 0x00240 0x00240 R 0x1000
LOAD 0x001240 0x1fff8240 0x1fff8240 0x03904 0x03904 RWE 0x1000
LOAD 0x005000 0x20000000 0x1fffbb44 0x00070 0x059b0 RW 0x1000
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
When using the elf file format the vector table gets linked directly
to 0x0 (0x180000 for data bus/A7 bus). U-Boots bootaux command tries
to be helpful and writes the start address to that location (since
this was necessary for binary files which have a relocated vector
table). This is not usually a problem, since we restore the stack
pointer imeaditly at the beginning.
However, the FreeRTOS port code relies on a complete vector table
(see prvPortStartFirstTask in Source/portable/GCC/ARM_CM4F/port.c).
This needs to be fixed in U-Boot: U-Boot should not write into the
vector table if it is provided by the elf binary.
For now, work around by restoring the stack pointer entry in the
vector table in the firmware startup code.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
The Cortex-M4 core starts executing at 0x00000000, which is OCRAM_S.
So far the bootloader (bootaux) copied the reset vector and the initial
stack pointer to that location, however, this does not work well when
using debuggers. Also, newer U-Boot support elf loading, which allow to
load the reset vector directly to the right location. It also safes some
bytes in the area where the firmware is stored.
This basically mandantes to use elf files since bin firmware files can
not be sparse... Hence disable building bin files by default.
Preserve the old linker files with _bin extension in case bin files are
still preferred.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Unify toolchain flags and use BspRootDirPath and ProjectName variables
to improve readability of CMakeLists.txt files.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
The section definitions of all linker scripts is actually the same,
unify them and use INCLUDE.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Convert CMake build files structure such that we can build debug
and release configuration simultaneously. This is useful when using
Eclipse's Makefile integration.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Suggested-by: Raul Munoz <raul.munoz@toradex.com>
|
|
Commit acebb1dd18 ("remove SABRE specific standby pin mux") introduced
an unused variable which leads to a warning. Remove it.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Initialize stack pointer in startup code. This fixes issues when
loading the firmware with loading mechanism which do not setup the
stack pointer correctly (e.g. Toradex U-Boot 2016.11 with elf file
format).
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
The i.MX 7Dual SABRE board uses a GPIO which allows to pu the CAN
transceiver into standby mode. This pin is not used on Colibri
designs, hence remove the pin mux/GPIO configuration.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Redefine vring_avail_event to avoid accessing ring.id as
a 16bit integer and breaking the C aliasing rules.
This fixes a build warning:
virtio/virtqueue.c: In function ‘vq_ring_must_notify_host’:
virtio/virtqueue.c:658:9: warning: dereferencing type-punned pointer will break
strict-aliasing rules [-Wstrict-aliasing]
event_idx = vring_avail_event(&vq->vq_ring);
^
No functional change.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Deduplicate debug/release variables by moving shared settings into
common variables.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Introduce BspRootDirPath to cleanup paths. Also suppress
generation of install files since we do cross compilation of
firmwares by default.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Avoid the following type of warning by properly use the default
variable CMAKE_FORCE_C_COMPILER and making sure compile tests
succeed:
The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set
CMAKE_C_COMPILER and allow CMake to identify the compiler.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Update to latest FreeRTOS of the V8 series. This contains lot
of bug fixes and new, useful features such as Task notifications.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|
|
Add interrupt and polling examples based on the stander colibri SPI (ECSPI3).
SODIMM_88 - SPI CLK
SODIMM_92 - SPI TXD
SODIMM_90 - SPI RXD
SODIMM_86 - SPI CS
To test this example, connect SODIMM_92 to SODIMM_90 in order to create a loop back.
Signed-off-by: Raul Munoz <raul.munoz@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
|