Tartarus changed the topic of #u-boot to: SOURCE MOVED TO https://source.denx.de/u-boot/u-boot.git / U-Boot v2024.01, v2024.04-rc4 are OUT / Merge Window is CLOSED, next branch is OPEN / Release v2024.04 is scheduled for 02 April 2024 / Channel archives at https://libera.irclog.whitequark.org/u-boot
<marex> abws: so ... that part is responsible for initializing the serial console, if you add print there and the serial console is not inited yet, the print has nowhere to go
<marex> so you wont see it
<marex> unless you have ... errr
<marex> CONFIG_DEBUG_UART of sorts, enabled
<marex> ( do you have JTAG access , so you could dump the memory address behind $blob and $str ?)
<abws> agreed, but could printing to stderr while the serial console is not inited crash u-boot TPL?
<abws> I do not have JTAG access (thoug I believe I have an openocd debug board around, I don't know if I can use it on that board, or even how to do that
<marex> abws: I dont think so
<marex> abws: the strings will be discarded
<marex> abws: you can try this CONFIG_DEBUG_UART stuff, but it is very rudimentary
<abws> CONFIG_DEBUG_UART is enabled . As I have debug logs printing when I do not had "fprintf(stderr" to scripts/dtc/libfdt/fdt_ro.c and that serial driver fails to load, it could already be working
<abws> might be that I made a mistake and TPL is crashing before debug uart could take over. With the clue you gave me I believ this is the next possibility
<marex> but DEBUG_UART is the thing which is used before the real UART driver takes over
<marex> btw try and compile SPL and TPL with CONFIG_REQUIRE_SERIAL_CONSOLE not defined
<marex> errr ... SPL_SERIAL_PRESENT / TPL_SERIAL_PRESENT , unset
<abws> mind I only have serial console access to the board
<abws> will this remove the serial output?
<abws> oh I get it, I will still have DEBUG_UART output
<marex> yes
<marex> right
<abws> ok I first tried with my fdt fprintf debug code disabled for TPL and TPL boot but then SPL does not (I kept my debug code for SPL). So I might have a bug in my debug code
<abws> ie by adding "if !defined(CONFIG_TPL_BUILD)" instead of relying on the idea that "if defined(CONFIG_SPL_BUILD)" should only apply to the SPL build
<marex> abws: I am a bit surprised that fprintf works, I'd generally stuck to printf() and puts() in these early stages
Leopold has quit [Ping timeout: 260 seconds]
Leopold has joined #u-boot
<abws> might be it does not work (that would explains why when I add it u-boot hang :-/
<abws> the fact is if I use printf the build fails because I believe this code is used to output to stdout (thus my debug code printing to stdout corrupt the output). With "fprintf(stderr" the code output my debug print to stderr during the build but fails to boot
<marex> both stdout and stderr go to the same serial console
<marex> and uboot does not run anything in parallel with anything else, it is all single threaded, in order execution
<abws> agreed but the stdout that is corrupted is during build where stdout and stderr are different (I don't mind the console outputting both interleaved ... but it seems I cannot output to stderr or u-boot hang for TPL and SPL
<abws> I mean the code I try to debug is used by u-boot build tools and u-boot code to interpret the dtb
<abws> if I output to stdout the build tools are broken
<marex> abws: uh ... huh ...
<marex> abws: are we no longer talking about the serial uclass ?
<abws> yeah I opened a can of worms when I tried to add printf to this piece of code... I will learn a lot but it will take times
<abws> the fact is both the serial-uclass and built tools use the same internal library code
<abws> libfdt
<marex> oh, I see
<marex> #if defined(USE_HOSTCC) ... host build #else ... target #endif
<marex> lib/hashtable.c:#ifdef USE_HOSTCC /* HOST build */
<abws> I first tried to add printf (stdout) but then the build tools "fdtgrep" for one, started to break the build. Then I tried fprintf to stderr (though for TPL and SPL this requires toa dd code to lib/tiny-printf.c as common/console.c has fprintf but calls to internal vscnprintf which is only defined for the main u-boot build ie from lib/vsprintf.c, not lib/tiny-printf.c
<abws> though the code for vscnprintf seems simple enough to copy n paste to lib/tiny-printf.c
<marex> abws: be careful that you dont overflow some binary size limit on SPL/TPL
<marex> maybe use the ifdef ... HOSTCC , that should limit your prints to host tools only, or target only
<abws> indeed, thanks. regarding the fact that you teach me that printing to stderr should not break u-boot, could well be my adding vscnprintf code to lib/tiny-printf.c gave an overflow ...
<marex> yeah, that could be it
<marex> (and it is more likely)
<abws> well ... I tried with my previous "if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)" before trying USE_HOSTCC, around my debug print which I replaced from "fprintf(sderr" by plain printf (removing the changed I had made to lib/tiny-printf.c for fprintf).
<abws> And now I get my debug code from SPL (also I found out that my issue with messing stdout in uboot build tools was moot with "defined(CONFIG_SLP_BUILD) .." as then the debug code was not build for the build tool too
<abws> to find out that my serial-uclass.c code that fails is not in SPL .. but with the main u-boot afterwards \o/ lol
<abws> still I learned a lot
peterm6881 has quit [Remote host closed the connection]
<abws> I did not know where was teh limit beteween SPL and main u-boot, :-P
<marex> SPL is usually the preloader in OCRAM/SRAM
<marex> U-Boot is usually in DRAM
<abws> ie I enabled verbose debug and I get messages before the panic, but it seems the banner "U-Boot SPL 2022.07-armbian (Mar 10 2024 - 13:09:30 +0000)" is only outputted once u-boot main is loaded (which does not complete here), so I assumed I was still in SPL
<abws> but teh fact I get the debug output prntf from the fdt code from SPL but not with the serial-uclass code is a clue to me that I am not in SPL anymore
<marex> 2022.07 ?
<abws> that was the previous u-boot for this board (thuswhy I am attempting to bring it to newer u-boot). Mind the vendor closed in 2021
<abws> marex: thanks ! I finaly got my debug printf to work (was u-boot main and I had to use printf not fprintf. Even for u-boot main "fprintf(stderr" freeze u-boot)
<marex> cool
Leopold has quit [Ping timeout: 260 seconds]
<abws> setting CONFIG_SERIAL_PRESENT to unset removed the panic on missing serial driver. I get the main 'Uboot .." banner then "initcall sequence 00000000002aa770 failed at call 0000000000203924 (err=-19)" which is dram_init from u-boot.map/u-boot.sym
<abws> stuff for another day :-)
<marex> well, DRAM init failed ?
Leopold has joined #u-boot
Leopold has quit [Excess Flood]
Leopold has joined #u-boot
qschulz has quit [Read error: Connection reset by peer]
qschulz has joined #u-boot
mmu_man has quit [Ping timeout: 252 seconds]
goliath has quit [Quit: SIGSEGV]
jclsn has quit [Ping timeout: 245 seconds]
alpernebbi has quit [Ping timeout: 255 seconds]
jclsn has joined #u-boot
naoki has quit [Quit: naoki]
alpernebbi has joined #u-boot
persmule has quit [Remote host closed the connection]
LeSpocky has quit [Ping timeout: 245 seconds]
pgreco_ has joined #u-boot
pgreco has quit [Ping timeout: 260 seconds]
LeSpocky has joined #u-boot
vagrantc has quit [Ping timeout: 245 seconds]
Leopold_ has joined #u-boot
Leopold has quit [Ping timeout: 260 seconds]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #u-boot
Leopold has joined #u-boot
Leopold_ has quit [Ping timeout: 260 seconds]
Leopold has quit [Remote host closed the connection]
Leopold has joined #u-boot
GNUtoo has quit [Remote host closed the connection]
GNUtoo has joined #u-boot
Leopold has quit [Remote host closed the connection]
enok has joined #u-boot
Leopold has joined #u-boot
Leopold has quit [Remote host closed the connection]
Leopold has joined #u-boot
Leopold has quit [Remote host closed the connection]
Leopold has joined #u-boot
Leopold has quit [Ping timeout: 260 seconds]
Leopold has joined #u-boot
enok has quit [Ping timeout: 264 seconds]
schroes has quit [Ping timeout: 264 seconds]
Leopold has quit [Remote host closed the connection]
rvalue has quit [Ping timeout: 252 seconds]
schroes has joined #u-boot
rvalue has joined #u-boot
Leopold has joined #u-boot
enok has joined #u-boot
enok has quit [Ping timeout: 260 seconds]
flyback has quit [Ping timeout: 255 seconds]
gsz has joined #u-boot
enok has joined #u-boot
flyback has joined #u-boot
GNUtoo has quit [Ping timeout: 260 seconds]
GNUtoo has joined #u-boot
Stat_headcrabed has joined #u-boot
enok has quit [Ping timeout: 268 seconds]
GNUtoo has quit [Ping timeout: 260 seconds]
GNUtoo has joined #u-boot
enok has joined #u-boot
enok has quit [Client Quit]
enok71 has joined #u-boot
enok71 is now known as enok
jfsimon1981 has joined #u-boot
<Kwiboo> abws: for rk3399 I suggest your start from current next branch instead of latest v2024.04-rc4, the next branch contains important bug fixes for rockchip
<Kwiboo> there is an issue on rk3328/rk3399 where the u-boot proper pre-relocation stack may overlap/overwrite part of .text/.data sections of u-boot.bin if the u-boot.bin ends up being bigger than around 1000 KiB in size
<Kwiboo> this limitation/issue was fixed in https://source.denx.de/u-boot/u-boot/-/commit/5e7cd8a119953dc2f466fea81e230d683ee03493 and is part of next branch
jfsimon1981 is now known as jfsimon
Stat_headcrabed has quit [Quit: Stat_headcrabed]
enok has quit [Ping timeout: 256 seconds]
mmu_man has joined #u-boot
alexxy has joined #u-boot
alexxy[home] has quit [Ping timeout: 256 seconds]
enok has joined #u-boot
dsimic has quit [Ping timeout: 260 seconds]
dsimic has joined #u-boot
goliath has joined #u-boot
enok has quit [Ping timeout: 255 seconds]
naoki has joined #u-boot
naoki has quit [Client Quit]
enok has joined #u-boot
monstr has joined #u-boot
persmule has joined #u-boot
<FergusL> Hey there, what are my options to save the stdout of a u-boot command to a file or environment variable?
<FergusL> running several uboot versions on same hardware and one of them doesn't have uboot shell over serial somehow -- i'll investigate that maybe
enok has quit [Ping timeout: 252 seconds]
Leopold has quit [Ping timeout: 260 seconds]
Leopold has joined #u-boot
monstr has quit [Remote host closed the connection]
Stat_headcrabed has joined #u-boot
jfsimon has quit [Remote host closed the connection]
jfsimon has joined #u-boot
Stat_headcrabed has quit [Quit: Stat_headcrabed]
enok has joined #u-boot
KREYREN has joined #u-boot
KREYREN has quit [Remote host closed the connection]
<marex> FergusL: I dont think there is that concept of redirection
Stat_headcrabed has joined #u-boot
Stat_headcrabed has quit [Client Quit]
<FergusL> Thanks a
<FergusL> marex * I figured I should first fix the issue that happens in the first place where the same device but different os and probably not very different uboot version doesn't show serial. I should not it's not very standard as it is a rockchip CPU
<FergusL> should note* namely the device is an emulation handheld, an R36S with RK3326 and distro A is JELOS where serial during uboot does *not* work but it does work with the same image on another supported rk3326 device, distro B is Arkos and serial during u-boot works
Perflosopher has quit [Ping timeout: 255 seconds]
Perflosopher has joined #u-boot
KREYREN has joined #u-boot
___nick___ has joined #u-boot
___nick___ has quit [Client Quit]
KREYREN has quit [Remote host closed the connection]
___nick___ has joined #u-boot
___nick___ has quit [Client Quit]
jfsimon has quit [Remote host closed the connection]
jfsimon has joined #u-boot
___nick___ has joined #u-boot
rvalue has quit [Ping timeout: 255 seconds]
rvalue has joined #u-boot
rvalue- has joined #u-boot
rvalue has quit [Ping timeout: 268 seconds]
rvalue- is now known as rvalue
<marex> FergusL: maybe try coninfo and setenv stdout serial or some such , might ungate the console
Leopold has quit [Ping timeout: 260 seconds]
Leopold has joined #u-boot
<FergusL> marex in boot.ini? this is the u-boot script file I'm using
<marex> probably on u-boot console, or insert it into u-boot environment from linux userspace using fw_setenv
<marex> I dont know what is in the boot.ini, sorry
<marex> if that is raw u-boot env, you can try that too
ikarso has joined #u-boot
jfsimon has quit [Remote host closed the connection]
jfsimon has joined #u-boot
mmu_man has quit [Ping timeout: 272 seconds]
mmu_man has joined #u-boot
vagrantc has joined #u-boot
___nick___ has quit [Ping timeout: 255 seconds]
slobodan has joined #u-boot
gsz has quit [Ping timeout: 260 seconds]
<abws> Kwiboo: tahnks a lot. With next branch the serial driver loads (so I guess chosen node is found) and rockchip dram_init succeeds (seems that with v2023.10 the rk3399-dmc node was not parsed).
<abws> now I have another issue .. out of memory in dm_scan (dm_scan() failed: -12 initcall failed at call 00000000f7f0ca60 (err=-12: Out of memory)
<abws> )
slobodan has quit [Read error: Connection reset by peer]
slobodan has joined #u-boot
naoki has joined #u-boot
slobodan has quit [Ping timeout: 264 seconds]
enok has quit [Read error: Connection reset by peer]
enok has joined #u-boot
enok has quit [Ping timeout: 264 seconds]
travmurav5 has joined #u-boot
travmurav has quit [Ping timeout: 255 seconds]
travmurav5 is now known as travmurav
<Kwiboo> abws: do I understand correctly that you are trying to get helios64 patches from armbian running with latest u-boot?
f_ has quit [Ping timeout: 268 seconds]
f_ has joined #u-boot
goliath has quit [Quit: SIGSEGV]
ikarso has quit [Quit: Connection closed for inactivity]
<Kwiboo> abws: I have an incoming rk3399 series that sync device trees and misc defconfig updates, tried to import the helios64 patch from armbian, droped all custom code, synced device tree and applied similar changes tunings that I have applied to other rk3399 boards
<Kwiboo> abws: hopefully https://github.com/Kwiboo/u-boot-rockchip/commits/rk3399-2024.07-temp can give you a starter plate
naoki has quit [Quit: naoki]