UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant jcruchaga
Participant
251 Views
Registered: ‎08-25-2017

How to create jffs2 in Petalinux 2017.3

Hi all,

I need to create my rootfs in the flash memory of my ZCU102 using jffs2.

Here is my petalinux configuration:

 


ConfigBoot.pngBoot settings

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ConfigDTB.pngDTB settingsConfigJFFS2.pngJFFS2 settingsConfigKernel.pngKernel settings

ConfigERASEJFF2s.pngErase block/FStype settingsConfigPartitions.pngPartition settings

Then I built (petalinux-build) my kernel (image.ub)/boot(BOOT.BIN)/rootfs (rootfs.jffs2) and installed them into my flash memory following the uboot commands, load_boot/install_boot, load_kernel, install_kernel, load_jffs2/install_jffs2.

Here is my uboot parameters definition:

ZynqMP> print
autoload=no
baudrate=115200
boot_img=BOOT.BIN
boot_targets=qspi0 <NULL>
bootargs=root=/dev/mtdblock3 rw rootfstype=jffs2
bootcmd=run default_bootcmd
bootdelay=4
bootenv=uEnv.txt
bootenvsize=0x40000
bootenvstart=0x2000000
bootsize=0x2000000
bootstart=0x0
clobstart=0x10000000
console=console=ttyPS0,115200
cp_kernel2ram=sf probe 0 && sf read ${netstart} ${kernelstart} ${kernelsize}
default_bootcmd=run uenvboot; run cp_kernel2ram && bootm ${netstart}
dfu_ram=run dfu_ram_info && dfu 0 ram 0
dfu_ram_info=setenv dfu_alt_info image.ub ram $netstart 0x1e00000
dtb_img=system.dtb
dtbnetstart=0x11800000
eraseenv=sf probe 0 && sf erase ${bootenvstart} ${bootenvsize}
ethact=ethernet@ff0e0000
ethaddr=00:0a:35:00:31:38
fault=echo ${img} image size is greater than allocated place - partition ${img} is NOT UPDATED
fdtcontroladdr=7ff7f420
fileaddr=10000000
filesize=600000
importbootenv=echo "Importing environment from SD ..."; env import -t ${loadbootenv_addr} $filesize
install_boot=sf probe 0 && sf erase ${bootstart} ${bootsize} && sf write ${clobstart} ${bootstart} ${filesize}
install_jffs2=sf probe 0 && sf erase ${jffs2start} ${jffs2size} && sf write ${clobstart} ${jffs2start} ${filesize}
install_kernel=sf probe 0 && sf erase ${kernelstart} ${kernelsize} && sf write ${clobstart} ${kernelstart} ${filesize}
ipaddr=10.228.56.10
jffs2_img=rootfs.jffs2
jffs2size=0x1600000
jffs2start=0x3680000
kernel_img=image.ub
kernelsize=0x1600000
kernelstart=0x2040000
load_boot=tftpboot ${clobstart} ${boot_img}
load_dtb=tftpboot ${clobstart} ${dtb_img}
load_jffs2=tftpboot ${clobstart} ${jffs2_img}
load_kernel=tftpboot ${clobstart} ${kernel_img}
loadaddr=0x10000000
loadbootenv=load mmc $sdbootdev:$partid ${loadbootenv_addr} ${bootenv}
loadbootenv_addr=0x00100000
modeboot=qspiboot
nc=setenv stdout nc;setenv stdin nc;
netboot=tftpboot ${netstart} ${kernel_img} && bootm
netstart=0x10000000
psserial0=setenv stdout ttyPS0;setenv stdin ttyPS0
sd_uEnvtxt_existence_test=test -e mmc $sdbootdev:$partid /uEnv.txt
sd_update_boot=echo Updating boot from SD; mmcinfo && fatload mmc 0:1 ${clobstart} ${boot_img} && run install_boot
sd_update_dtb=echo Updating dtb from SD; mmcinfo && fatload mmc 0:1 ${clobstart} ${dtb_img} && run install_dtb
sd_update_jffs2=echo Updating jffs2 from SD; mmcinfo && fatload mmc 0:1 ${clobstart} ${jffs2_img} && run install_jffs2
sd_update_kernel=echo Updating kernel from SD; mmcinfo && fatload mmc 0:1 ${clobstart} ${kernel_img} && run install_kernel
sdbootdev=0
serial=setenv stdout serial;setenv stdin serial
serverip=10.228.56.30
setup=setenv partid auto
test_crc=if imi ${clobstart}; then run test_img; else echo ${img} Bad CRC - ${img} is NOT UPDATED; fi
test_img=setenv var "if test ${filesize} -gt ${psize}; then run fault; else run ${installcmd}; fi"; run var; setenv var
thor_ram=run dfu_ram_info && thordown 0 ram 0
uenvboot=if run sd_uEnvtxt_existence_test; then run loadbootenv; echo Loaded environment from ${bootenv}; run importbootenv; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd; fi
update_boot=setenv img boot; setenv psize ${bootsize}; setenv installcmd "install_boot"; run load_boot test_img; setenv img; setenv psize; setenv installcmd
update_dtb=setenv img dtb; setenv psize ${dtbsize}; setenv installcmd "install_dtb"; run load_dtb test_img; setenv img; setenv psize; setenv installcmd
update_jffs2=setenv img jffs2; setenv psize ${jffs2size}; setenv installcmd "install_jffs2"; run load_jffs2 test_img; setenv img; setenv psize; setenv installcmd
update_kernel=setenv img kernel; setenv psize ${kernelsize}; setenv installcmd "install_kernel"; run load_kernel test_crc; setenv img; setenv psize; setenv installcmd

Environment size: 3815/262140 bytes
ZynqMP> print bootargs
bootargs=root=/dev/mtdblock3 rw rootfstype=jffs2
ZynqMP>

 

After that I reset my board and here the final of my output:

....

[ 92.602093] jffs2: Further such events for this erase block will not be printed
[ 92.609705] jffs2: Node at 0x00623dc8 with length 0x00001044 would run over the end of the erase block
[ 92.618944] jffs2: Perhaps the file system was created with the wrong erase size?
[ 92.626568] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00624000: 0x8379 instead
[ 92.635984] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00624004: 0x536d instead
[ 92.645443] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00624008: 0x9ddb instead
[ 92.654903] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0062400c: 0x2fc4 instead
[ 92.664364] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00624010: 0x3fba instead
[ 92.673826] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00624014: 0x1c5e instead
[ 92.683287] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00624018: 0xcbe2 instead
[ 92.692759] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0062401c: 0x2f2b instead
[ 92.702212] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00624020: 0x5782 instead
[ 92.711671] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00624024: 0x1281 instead
[ 92.721131] jffs2: Further such events for this erase block will not be printed
[ 92.728739] jffs2: Node at 0x00625e50 with length 0x00001044 would run over the end of the erase block
[ 92.737973] jffs2: Perhaps the file system was created with the wrong erase size?
[ 92.745591] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00626000: 0x9f92 instead
[ 92.755006] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00626004: 0x3f8c instead
[ 92.764464] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00626008: 0xe6db instead
[ 92.773925] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0062600c: 0xc764 instead
[ 92.783386] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00626010: 0xd3b2 instead
[ 92.792847] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00626014: 0xe443 instead
[ 92.802316] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00626018: 0x6b0f instead
[ 92.811771] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0062601c: 0x2baa instead
[ 92.821231] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00626020: 0x0d86 instead
[ 92.830718] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00626024: 0x6575 instead
[ 92.840154] jffs2: Further such events for this erase block will not be printed
[ 92.847764] jffs2: Node at 0x00627ed8 with length 0x00001044 would run over the end of the erase block
[ 92.857003] jffs2: Perhaps the file system was created with the wrong erase size?
[ 92.864622] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00628000: 0x1812 instead
[ 92.874036] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00628004: 0x79ee instead
[ 92.883494] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00628008: 0x8256 instead
[ 92.892955] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0062800c: 0x4c88 instead
[ 92.902415] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00628010: 0x1832 instead
[ 92.911884] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00628014: 0x8306 instead
[ 92.921339] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00628018: 0x169e instead
[ 92.930801] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0062801c: 0x5728 instead
[ 92.940261] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00628020: 0x2101 instead
[ 92.949726] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00628024: 0xa0d4 instead
[ 92.959182] jffs2: Further such events for this erase block will not be printed
[ 92.966832] jffs2: Node at 0x00629fdc with length 0x0000002b would run over the end of the erase block
[ 92.976067] jffs2: Perhaps the file system was created with the wrong erase size?
[ 92.983678] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0062a000: 0xa45a instead
[ 92.993092] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0062a004: 0x6d74 instead
[ 93.287397] jffs2: notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) a nd 0 of xref (0 dead, 0 orphan) found.
[ 93.304695] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[ 93.310891] devtmpfs: mounted
[ 93.313901] Freeing unused kernel memory: 512K (ffffffc000c40000 - ffffffc000cc0000)
[ 93.350764] init[1]: undefined instruction: pc=0000007fa3877900
[ 93.356619] Code: 00000000 00000000 00000000 00000000 (00000000)
[ 93.362810] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[ 93.362810]
[ 93.371872] CPU: 1 PID: 1 Comm: init Not tainted 4.9.0-xilinx-v2017.3 #1
[ 93.378540] Hardware name: ZynqMP ZCU102 RevB (DT)
[ 93.383313] Call trace:
[ 93.385750] [<ffffff8008088138>] dump_backtrace+0x0/0x198
[ 93.391128] [<ffffff80080882e4>] show_stack+0x14/0x20
[ 93.396163] [<ffffff80083de514>] dump_stack+0x94/0xb8
[ 93.401198] [<ffffff800812e9a8>] panic+0x114/0x25c
[ 93.405971] [<ffffff800809d898>] complete_and_exit+0x0/0x20
[ 93.411527] [<ffffff800809e810>] do_group_exit+0x38/0xa8
[ 93.416822] [<ffffff80080a84f8>] get_signal+0x240/0x4e0
[ 93.422029] [<ffffff8008087704>] do_signal+0x184/0x550
[ 93.427150] [<ffffff8008087d00>] do_notify_resume+0x90/0xa0
[ 93.432705] [<ffffff8008082ddc>] work_pending+0x8/0x10
[ 93.437823] SMP: stopping secondary CPUs
[ 93.441925] Kernel Offset: disabled
[ 93.445331] Memory Limit: none
[ 93.448372] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
[ 93.448372]
[ 93.458292] ------------[ cut here ]------------
[ 93.462872] WARNING: CPU: 1 PID: 1 at /home/tecnobit/Escritorio/zcu102_Orig_Custom/xilinx-zcu102-zu9-es1-2017.3/build/tmp/work-share d/plnx_aarch64/kernel-source/kernel/time/tick-broadcast.c:642 tick_handle_oneshot_broadcast+0x1a8/0x1b0
[ 93.483717] Modules linked in:
[ 93.486732]
[ 93.488211] CPU: 1 PID: 1 Comm: init Not tainted 4.9.0-xilinx-v2017.3 #1
[ 93.494896] Hardware name: ZynqMP ZCU102 RevB (DT)
[ 93.499670] task: ffffffc87b876c00 task.stack: ffffffc87b878000
[ 93.505574] PC is at tick_handle_oneshot_broadcast+0x1a8/0x1b0
[ 93.511389] LR is at tick_handle_oneshot_broadcast+0xe8/0x1b0
[ 93.517117] pc : [<ffffff80080f9ea8>] lr : [<ffffff80080f9de8>] pstate: 200001c5
[ 93.524501] sp : ffffffc87ff81e70
[ 93.527791] x29: ffffffc87ff81e70 x28: 0000000000000008
[ 93.533085] x27: ffffff8008d6e000 x26: 00000015c276f8b6
[ 93.538379] x25: ffffff8008cc7000 x24: ffffff8008d6ef70
[ 93.543674] x23: ffffff8008d6ef48 x22: 0000000000000000
[ 93.548969] x21: ffffff8008c96548 x20: 7fffffffffffffff
[ 93.554264] x19: 0000000000000008 x18: 0000000000000010
[ 93.559559] x17: 0000000000000001 x16: 0000007ff4b10198
[ 93.564854] x15: 00000000000003b0 x14: 000000000000001b
[ 93.570148] x13: 0000000000000000 x12: 00000000000003b0
[ 93.575443] x11: ffffff80089694c8 x10: ffffffc87ff88a30
[ 93.580738] x9 : 0000000000000000 x8 : 0000000000000020
[ 93.586033] x7 : 7fffffffffffffff x6 : 00000000f9b018bf
[ 93.591328] x5 : 0000000000000000 x4 : 0000000000000000
[ 93.596623] x3 : 0000000000000001 x2 : 0000000000000002
[ 93.601918] x1 : ffffff8008cde000 x0 : 000000000000000c
[ 93.607212]
[ 93.608689] ---[ end trace 1c0abfce5ddabd10 ]---
[ 93.613290] Call trace:
[ 93.615722] Exception stack(0xffffffc87ff81ca0 to 0xffffffc87ff81dd0)
[ 93.622148] 1ca0: 0000000000000008 0000008000000000 ffffffc87ff81e70 ffffff80080f9ea8
[ 93.629967] 1cc0: 0000000000000400 0000000000000040 0000000100000000 0000000000000001
[ 93.637778] 1ce0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[ 93.645591] 1d00: 0000000000000000 0000000000000400 0000000000000400 0000000000000001
[ 93.653403] 1d20: 0000000000000001 0000000000000000 ffffffc87ff81d40 ffffff80080c4ea4
[ 93.661215] 1d40: 000000000000000c ffffff8008cde000 0000000000000002 0000000000000001
[ 93.669027] 1d60: 0000000000000000 0000000000000000 00000000f9b018bf 7fffffffffffffff
[ 93.676839] 1d80: 0000000000000020 0000000000000000 ffffffc87ff88a30 ffffff80089694c8
[ 93.684651] 1da0: 00000000000003b0 0000000000000000 000000000000001b 00000000000003b0
[ 93.692462] 1dc0: 0000007ff4b10198 0000000000000001
[ 93.697317] [<ffffff80080f9ea8>] tick_handle_oneshot_broadcast+0x1a8/0x1b0
[ 93.704175] [<ffffff80080fae08>] bc_handler+0x20/0x60
[ 93.709211] [<ffffff80080ed1e8>] __hrtimer_run_queues+0xf0/0x178
[ 93.715198] [<ffffff80080ed578>] hrtimer_interrupt+0x98/0x1c8
[ 93.720929] [<ffffff80086e10b0>] arch_timer_handler_phys+0x30/0x40
[ 93.727092] [<ffffff80080dfa70>] handle_percpu_devid_irq+0x78/0x128
[ 93.733340] [<ffffff80080da774>] generic_handle_irq+0x24/0x38
[ 93.739068] [<ffffff80080dadec>] __handle_domain_irq+0x5c/0xb8
[ 93.744884] [<ffffff80080814cc>] gic_handle_irq+0x64/0xc0
[ 93.750264] Exception stack(0xffffffc87b87ba70 to 0xffffffc87b87bba0)
[ 93.756689] ba60: 0000000000000051 ffffff8008cda9c8
[ 93.764508] ba80: 000000000000c73e 0000000000000000 0000000000000000 ffffff800843f498
[ 93.772320] baa0: ffffff8008d5a247 206c656e72654b20 000000000006d774 0000000000000070
[ 93.780132] bac0: 00000000000027a7 ffffffc87b87b900 69206c6c696b206f ffffff8008d5a245
[ 93.787944] bae0: ffffff8088d5a237 0000000000000006 0000007ff4b10198 0000000000000001
[ 93.795756] bb00: 0000000000000010 ffffff8008d56150 ffffff8008d56150 0000000000000000
[ 93.803568] bb20: ffffff8008d56150 0000000000000000 ffffff8008cc5000 ffffffc87b87bde8
[ 93.811381] bb40: 00000000418004fc ffffffc87b87f5a0 ffffffc87b878000 ffffffc87b87bba0
[ 93.819192] bb60: ffffff800812eaa0 ffffffc87b87bba0 ffffff800812eaa4 0000000060000145
[ 93.827004] bb80: 0000000000000000 ffffff800843f498 0000008000000000 0000000000000000
[ 93.834816] [<ffffff80080827b0>] el1_irq+0xb0/0x140
[ 93.839671] [<ffffff800812eaa4>] panic+0x210/0x25c
[ 93.844445] [<ffffff800809d898>] complete_and_exit+0x0/0x20
[ 93.850001] [<ffffff800809e810>] do_group_exit+0x38/0xa8
[ 93.855295] [<ffffff80080a84f8>] get_signal+0x240/0x4e0
[ 93.860503] [<ffffff8008087704>] do_signal+0x184/0x550
[ 93.865624] [<ffffff8008087d00>] do_notify_resume+0x90/0xa0
[ 93.871179] [<ffffff8008082ddc>] work_pending+0x8/0x10

 

I've try to modify the erase block size into petalinux config (8,16,32,64) but always the result is the same.

¿Is my procedure correct? ¿Is there any documentation where I can check how to create a jffs2?

 

Thank you.

 

 

 

0 Kudos