summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-02-06Fix UART examples for Colibri iMX7colibri-imx7-m4-freertos-v8Andy Kiser
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>
2018-08-30use -Og for debuggingStefan Agner
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>
2018-08-30store .data section directly in RAM areaStefan Agner
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>
2018-05-29fix FlexCAN1 pinmuxingStefan Agner
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>
2018-05-23switch to FlexCAN instance 1Stefan Agner
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>
2018-05-15examples: fix missing gpio_ctrl.h errorsStefan Agner
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>
2017-05-29examples: gpio_freertos: example with gpio, FreeRTOS and rpmsgRaul Munoz
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>
2017-05-29examples: gpio_bank2_imx: gpio example using just GPIO2Raul Munoz
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>
2017-05-29examples: webinar: Config files to be used in the webinarRaul Munoz
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>
2017-05-22fix strict alias warningStefan Agner
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>
2017-05-22hello_world_ddr: add RDC memory mappingStefan Agner
Configure RDC memory mapping when running firmware from DDR. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-05-22MCIMX7D_M4_ddr: add symbols for memory areaStefan Agner
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>
2017-05-22rdc: add macros for memory alignmentStefan Agner
Add helper macros which allow to align memory for RDC memory region mappings. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-05-22examples: str_echo_freertos: update CMake structureRaul Munoz
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>
2017-05-22examples: rpmsg_str_echo_bm: update CMake structureRaul Munoz
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>
2017-05-22examples: hello_world_ddr: update CMake structureRaul Munoz
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>
2017-05-22examples: hello_world_ocram: update CMake structureRaul Munoz
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>
2017-05-22examples: rand_wfi: update CMake structureRaul Munoz
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>
2017-05-22examples: sema4_demo: update CMake structureRaul Munoz
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>
2017-05-22examples: wdog_imx: update CMake structureRaul Munoz
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>
2017-05-22examples: adc_imx7d: update CMake structureRaul Munoz
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>
2017-05-22examples: gpt: update CMake structureRaul Munoz
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>
2017-05-22examples: uart_polling: update CMake structureRaul Munoz
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>
2017-05-22examples: uart_interrupt: update CMake structureRaul Munoz
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>
2017-05-22examples: i2c_polling_sensor_imx7d: update CMake structureRaul Munoz
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>
2017-05-22examples: i2c_interrupt_sensor_imx7d: update CMake structureRaul Munoz
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>
2017-05-22examples: flexcan_network: update CMake structureRaul Munoz
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>
2017-05-22examples: flexcan_loopback: update CMake structureRaul Munoz
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>
2017-05-22examples: ecspi_polling_master: update CMake structureRaul Munoz
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>
2017-05-22examples: ecspi_interrupt_master: update CMake structureRaul Munoz
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>
2017-05-22examples: pingpong_bm: update CMake structureRaul Munoz
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>
2017-05-22examples: pingpong_freertos: update CMake structureRaul Munoz
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>
2017-05-19examples: gpio_imx: update CMake structureRaul Munoz
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>
2017-05-19examples: blinking_imx_demo: update CMake structureRaul Munoz
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>
2017-05-19examples: add eclipse generatorRaul Munoz
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>
2017-05-16force program header alignment to be smaller than 32kbytesStefan Agner
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>
2017-05-16restore stackpointer in vector tableStefan Agner
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>
2017-05-16use OCRAM_S for interrupt vectors by defaultStefan Agner
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>
2017-05-12improve CMakeLists.txtStefan Agner
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>
2017-05-12unify linker scriptsStefan Agner
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>
2017-05-12examples: convert CMake structure to allow multiple buildsStefan Agner
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>
2017-05-08fix warning of unused variableStefan Agner
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>
2017-05-03startup: initialize stack pointer in startup codeStefan Agner
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>
2017-05-01remove SABRE specific standby pin muxStefan Agner
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>
2017-04-07virtio: Redefine vring_avail_eventColibri-iMX7-M4_FreeRTOS_1.2-20170407Stefan Agner
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>
2017-03-24simplify CMake makefileStefan Agner
Deduplicate debug/release variables by moving shared settings into common variables. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2017-03-24simplify CMake by using BspRootDirPathStefan Agner
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>
2017-03-24avoid using deprecated CMake featuresStefan Agner
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>
2017-02-20update to FreeRTOS V8.2.3Stefan Agner
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>
2017-02-20spi: example: add SPI exampleRaul Munoz
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>