0

I have imx7d-pico with Carrier board. This tiny computer was used a lot for Android Things. PDF (datasheet) easily found.

I stay (during the last two weeks) trying this tutorial: https://github.com/TechNexion/freertos-tn/tree/freertos_1.0.1_imx7d

 export ARMGCC_DIR=${HOME}/gcc-arm-none-eabi-4_9-2015q3/
 after ./build_release.sh I do
 sudo cp ${HOME}/freertos-tn/examples/imx7d_pico_m4/demo_apps/hello_world/armgcc/release/hello_world.bin
/media/neuberfran/boot
 ls mmc 0:1 (result command in U-boot)
 10572   hello_world.bin

  then:
=> fatload mmc 0:1 0x7F8000 hello_world.bin (with issue) 
   ** Reading file would overwrite reserved memory **
   Failed to load 'hello_world.bin 
=> dcache flush (I can't)
=> bootaux 0x7F8000 (I can't)

I'm correctly generating my image Yocto-hardknott-technexion with this:

$ mkdir tn-imx-yocto
$ cd tn-imx-yocto
$ repo init -u https://github.com/TechNexion/tn-imx-yocto-manifest.git -b hardknott_5.10.y-next -m imx-5.10.52-2.1.0.xml
$ repo sync -j8
$ DISTRO=fsl-imx-x11 MACHINE=pico-imx7 BASEBOARD=pi source tn-setup-release.sh -b build-x11-pico-imx7
$ bitbake core-image-base

imx7d-pico-pi-qca-m4.dts

#include "imx7d-pico-pi-qca.dts"

/ {
    memory {
        linux,usable-memory = <0x80000000 0x1ff00000>;
    };

    m4_tcm: tcml@007f8000 {
        compatible = "fsl, m4_tcml";
        reg = <0x007f8000 0x8000>;
    };

    gpio-leds {
        status = "disabled";
    };
};

&adc1 {
    status = "disabled";
};

&adc2 {
    status = "disabled";
};

&gpt3 {
    status = "disabled";
};

&gpt4 {
    status = "disabled";
};

&ocram {
    reg = <0x00901000 0xf000>;
};

&rpmsg{
    vdev-nums = <1>;
    reg = <0x9fff0000 0x10000>;
    status = "okay";
};

&uart6 {
    status = "disabled";
};

&wdog3{
    status = "disabled";

pico-imx7.conf

#@TYPE: Machine
#@NAME: pico-imx7
#@SOC: i.MX7/Solo/Dual/UtraLowPower
#@DESCRIPTION: Machine configuration for PICO-IMX7 with QCA(Qualcomm)/BRCM(Broadcom) WLAN module
#@MAINTAINER: Po Cheng <po.cheng@technexion.com>

MACHINEOVERRIDES =. "mx7:mx7d:"
MACHINEOVERRIDES_EXTENDER_pico-imx7 = "uenv"

include conf/machine/include/imx-base.inc
include conf/machine/include/tune-cortexa7.inc
require conf/machine/tn-base.inc

#
# Kernel Device Trees
#
PREFERRED_PROVIDER_virtual/kernel ?= "linux-tn-imx"
PREFERRED_PROVIDER_virtual/kernel_mx7 = "linux-tn-imx"

KERNEL_DEVICETREE = "imx7d-pico-pi-qca.dtb" 
#                         imx7d-pico-pi-m4.dtb \
#"
KERNEL_DEVICETREE_append = " imx7d-pico-pi-m4.dtb"
#                    imx7d-pico-pi.dtb \
#                     imx7d-pico-pi-c2-qca.dtb imx7d-pico-pi-c2.dtb \
#                     imx7d-pico-nymph-qca.dtb imx7d-pico-nymph.dtb \
#                     imx7d-pico-dwarf-qca.dtb imx7d-pico-dwarf.dtb \
#                     imx7d-pico-hobbit-qca.dtb imx7d-pico-hobbit.dtb \
#"

# Setup the additional devicetree file
#KERNEL_DEVICETREE_append_voicehat = " imx7d-pico-pi-qca-voicehat.dtb \
#                                      imx7d-pico-pi-voicehat.dtb \
#                                      imx7d-pico-pi-c2-qca-voicehat.dtb \
#                                      imx7d-pico-pi-c2-voicehat.dtb "

# Bootloader Specifics
UBOOT_MACHINE = "pico-imx7d_spl_defconfig"

#M4_MACHINE = "pico-imx7d-pi"
#IMAGE_BOOTFILES_DEPENDS += "imx-m4-demos-tn:do_deploy"
#IMAGE_BOOTFILES += "hello_world.bin rpmsg_lite_pingpong_rtos_linux_remote.bin rpmsg_lite_str_echo_rtos_imxcm4.bin"

In U-boot printenv command currently I have nothing about m4 and tcm

printenv                                
arch=arm
baseboard=pi
baudrate=115200
board=pico-imx7d
board_name=pico-imx7d
boot_fdt=try
bootcmd=mmc dev ${mmcdev}; if mmc rescan; then if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadbootscript; then run bootscript; fi; if run loadfit; then run fitboot; fi; if run loadimage; then run mmcboot; else echo WARN: Cannot load kernel from boot media; fi; else run netboot; fi
bootdelay=2
bootenv=uEnv.txt
bootscript=echo Running bootscript from mmc ...; source
console=ttymxc4
cpu=armv7
default_baseboard=pi
fastboot_dev=mmc0
fbcmd=fastboot 0
fdt_addr=0x83000000
fdt_file=imx7d-pico-pi-qca-m4.dtb
fdt_high=0xffffffff
fdtcontroladdr=9cd62ed0
fit_addr=0x87880000
fit_high=0xffffffff
fit_overlay=for ov in ${dtoverlay}; do echo Overlaying ${ov}...; setenv fitov "${fitov}#${ov}"; done; echo fit conf: ${fdtfile}${fitov};
fitargs=setenv bootargs console=${console},${baudrate} root=/dev/ram0 rootwait rw modules-load=g_acm_ms g_acm_ms.stall=0 g_acm_ms.removable=1 g_acm_ms.file=${mmcrootdev} g_acm_ms.iSerialNumber=00:00:00:00:00:00 g_acm_ms.iManufacturer=TechNexion
fitboot=echo Booting from FIT image...; run searchbootdev; run setfdt; run fit_overlay; run fitargs; bootm ${fit_addr}#conf@${fdtfile}${fitov};
fitov=""
form=pico
image=zImage
importbootenv=echo Importing environment from mmc ...; env import -t -r $loadaddr $filesize
initrd_high=0xffffffff
ip_dyn=yes
loadaddr=0x80800000
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdtfile}
loadfit=fatload mmc ${mmcdev}:${mmcpart} ${fit_addr} tnrescue.itb
loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot} 
mmcautodetect=yes
mmcboot=echo Booting from mmc ...; run m4boot; run searchbootdev; run mmcargs; echo baseboard is ${baseboard}; run setfdt; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then echo WARN: Cannot load the DT; echo fall back to load the default DT; setenv baseboard ${default_baseboard}; run setfdt; run loadfdt; bootz ${loadaddr} - ${fdt_addr}; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
mmcdev=0
mmcpart=1
netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
netboot=echo Booting from net ...; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; run loadbootenv; run importbootenv; run setfdt; run netargs; ${get_cmd} ${loadaddr} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdtfile}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
script=boot.scr
searchbootdev=if test ${bootdev} = SD0; then setenv mmcrootdev /dev/mmcblk2; setenv mmcroot /dev/mmcblk2p2 rootwait rw; else setenv mmcrootdev /dev/mmcblk0; setenv mmcroot /dev/mmcblk0p2 rootwait rw; fi
serial#=0091ceb8deadbeef
setfdt=if test -n ${wifi_module} && test ${wifi_module} = qca; then setenv fdtfile ${som}-${form}-${baseboard}-${wifi_module}${mcu}.dtb; else setenv fdtfile ${som}-${form}-${baseboard}${mcu}.dtb;fi
soc=mx7
soc_type=imx7d
som=imx7d
splashimage=0x8c000000
splashpos=m,m
splashsource=mmc_fs
stdout=serial
update_m4_from_sd=if sf probe 0:0; then if run loadm4image; then setexpr fw_sz ${filesize} + 0xffff; setexpr fw_sz ${fw_sz} / 0x10000; setexpr fw_sz ${fw_sz} * 0x10000; sf erase 0x0 ${fw_sz}; sf write ${loadaddr} 0x0 ${filesize}; fi; fi
vendor=technexion
wifi_module=qca

Environment size: 3808/8188 bytes

How can I solve this? (pls)

  • @Clifford Thanks for replying but you are wrong. I have an imx7d-pico (with a7 and m4). On m4 you can run FreeRTOS. Even the next step is to make RPMsg where linux/a7 communicates with RTOS/M4 (https://mcuoneclipse.com/2016/10/23/tutorial-running-freertos-on-nxp-i-mx7dual-cortex-m4f/ –  Feb 10 '22 at 23:51
  • 2
    The command that apparently is the issue is a **U-Boot** command. You specified the incorrect tags, Tags have been corrected. – sawdust Feb 10 '22 at 23:53
  • 2
    I am no u-boot expert but would guess that you need to use the `loadaddr` defined (`0x80800000`) rather than `0x7F8000` perhaps? – Clifford Feb 10 '22 at 23:54
  • 1
    @sawdust . Yes the command that is the issue is a U-Boot command –  Feb 10 '22 at 23:54
  • 1
    ... Moreover `update_m4_from_sd` uses `loadaddr` so my guess would be: . `fatload mmc 0:1 ${loadaddr} hello_world.bin`, `dcache flush`, then `bootaux ${loadaddr}` perhaps? – Clifford Feb 11 '22 at 00:08
  • @Clifford I'm having evolutions with 0x80800000. I still don't know why. I'll be back soon with more information –  Feb 11 '22 at 00:12
  • Your problem is very poorly described. The post is full of superfluous information, while you neglect to provide salient details. You need to clearly identify the board, its SoC,, the target environment (U-Boot), the source of the program that has issue (the U-Boot standalone example?) and how it was built (e.g. its linker map). Study the SoC datasheet/reference-manual for the SoC memory map. – sawdust Feb 11 '22 at 00:15
  • 1
    `0x7F8000` is a peculiar memory address. Why are you using that value? The [NXP Appnote](https://www.nxp.com/docs/en/application-note/AN5317.pdf) has a typo in Table 5, making the doc less helpful. – sawdust Feb 11 '22 at 00:25
  • 1
    @sawdust U-Boot 2021.04-395e9287b20746443d90ee878234368d5e066a53+g395e9287b2 (Dec 13 2021 - 09:13:59 +0000) CPU: i.MX7D rev1.2 1000 MHz (running at 792 MHz) Model: TechNexion PICO-IMX7D Board and PI baseboard Board: i.MX7D PICOSOM –  Feb 11 '22 at 00:43
  • 1
    @sawdust I have imx7d-pico with Carrier board. This tiny computer was used a lot for Android Things. PDF (datasheet) easily found –  Feb 11 '22 at 00:46
  • 1
    @sawdust I stay using 0x7F8000 because in the official technexion tutorial (link at the beginning of this issue) they use this address –  Feb 11 '22 at 01:19
  • 1
    @sawdust I talked about Yocto, because in pico-imx7.conf file (edited in this issue) has options to put m4 directly in the initial build –  Feb 11 '22 at 01:21
  • Stop using comments for salient info that instead should be edited into your post. *"How can I solve this?"* -- (1) Rebuild U-Boot with debugging capability so that the LMB structure is dumped (https://elixir.bootlin.com/u-boot/v2021.04/source/lib/lmb.c#L45) before the error is reported (https://elixir.bootlin.com/u-boot/v2021.04/source/fs/fs.c#L521) ***OR*** analyze the U-Boot code and/or config files to determine what values are in that structure that describes memory blocks. (2) Instead of blindly following a tutorial, study the NXP Appnote that I previously linked. – sawdust Feb 11 '22 at 23:16
  • @sawdust The u-boot in my case is pulled and built directly from the technexion directory (manufacturer). This whole task mentioned above becomes more difficult –  Feb 12 '22 at 02:57

1 Answers1

0
I solved with two changes in device-tree files:

in imx7d.dtsi
I put status = "okay";
in rpmsg: rpmsg{

in imx7d-pico-pi-qca-m4.dts
I put:

reserved-memory {
        rpmsg_vrings: vrings0@0x8ff00000 {
            reg = <0x8fff0000 0x10000>;
            no-map;
        };
    };

&

&rpmsg{
    memory-region = <&rpmsg_vrings>;
    vdev-nums = <1>;
    reg = <0x9fff0000 0x10000>;
    status = "okay";
};
neuberfran
  • 359
  • 3
  • 18