Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an sdcard image that can be written directly to sdcard #2

Open
rosaschafe opened this issue Feb 16, 2023 · 1 comment
Open

Comments

@rosaschafe
Copy link

rosaschafe commented Feb 16, 2023

Hello,

I would like to know how to make an SD card image easily

First, I followed https://github.com/Jun1172/nuc980-open-source-project
https://blog.csdn.net/Jun626/article/details/104730949
https://blog.csdn.net/Jun626/article/details/104737311

And I then tried to dd it as the documentation (NUC980 NuWriter User Manual EN.pdf) said the bootloader is going to check SD card at 0x400 for signature and boot it.
I used the writer tool to generate the pack.bin (run.ini attached) and did sudo dd ibs=32 iseek=1 if=pack.bin of=/dev/mmcblk0 obs=1024 oseek=1 but It didnt work.

After some tries, I found out that I have to use the devkit in USB mode along with nuc980 writer commandline tool (after I change pack = yes to pack = no).

using that I was able to boot uboot off the sd card

so, I compared the two sd card [working and non working] images first bytes and found the diff:

┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
│*       │                         ┊                         │        ┊        │
│00000200│ 57 42 55 aa 01 00 00 00 ┊ ff ff ff ff 57 42 59 63 │WBUו⋄⋄⋄┊××××WBYc│
│00000210│ 00 00 01 00 00 00 08 00 ┊ 00 02 00 00 7f 00 08 00 │⋄⋄•⋄⋄⋄•⋄┊⋄•⋄⋄•⋄•⋄│
│00000220│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
│00000230│ ff ff ff ff ff ff ff ff ┊ ff ff ff ff ff ff ff ff │××××××××┊××××××××│
│*       │                         ┊                         │        ┊        │
│00000400│ 20 54 56 4e 00 00 e0 00 ┊ e0 62 03 00 ff ff ff ff │ TVN⋄⋄×⋄┊×b•⋄××××│
│00000410│ 00 08 40 00 00 00 00 00 ┊ 00 ff ff ff ff ff ff ff │⋄•@⋄⋄⋄⋄⋄┊⋄×××××××│
│00000420│ 55 aa 55 aa 2e 00 00 00 ┊ 64 02 00 b0 18 00 00 c0 │U×U×.⋄⋄⋄┊d•⋄ו⋄⋄×│
│00000430│ 20 02 00 b0 18 00 00 01 ┊ aa 55 aa 55 01 00 00 00 │ •⋄ו⋄⋄•┊×U×U•⋄⋄⋄│
│00000440│ aa 55 aa 55 01 00 00 00 ┊ 28 20 00 b0 4a d8 dc 53 │×U×U•⋄⋄⋄┊( ⋄×J××S│
│00000450│ 08 20 00 b0 14 80 00 00 ┊ aa 55 aa 55 01 00 00 00 │• ⋄ו×⋄⋄┊×U×U•⋄⋄⋄│
│00000460│ aa 55 aa 55 01 00 00 00 ┊ aa 55 aa 55 01 00 00 00 │×U×U•⋄⋄⋄┊×U×U•⋄⋄⋄│
│00000470│ 00 20 00 b0 7e 04 03 00 ┊ aa 55 aa 55 01 00 00 00 │⋄ ⋄×~••⋄┊×U×U•⋄⋄⋄│
│00000480│ 04 20 00 b0 21 00 00 00 ┊ aa 55 aa 55 01 00 00 00 │• ⋄×!⋄⋄⋄┊×U×U•⋄⋄⋄│
│00000490│ 04 20 00 b0 23 00 00 00 ┊ aa 55 aa 55 01 00 00 00 │• ⋄×#⋄⋄⋄┊×U×U•⋄⋄⋄│
│000004a0│ aa 55 aa 55 01 00 00 00 ┊ aa 55 aa 55 01 00 00 00 │×U×U•⋄⋄⋄┊×U×U•⋄⋄⋄│
│000004b0│ 04 20 00 b0 27 00 00 00 ┊ 20 20 00 b0 00 00 00 00 │• ⋄×'⋄⋄⋄┊  ⋄×⋄⋄⋄⋄│
│000004c0│ 24 20 00 b0 00 00 00 00 ┊ 1c 20 00 b0 00 40 00 00 │$ ⋄×⋄⋄⋄⋄┊• ⋄×⋄@⋄⋄│
│000004d0│ 18 20 00 b0 32 03 00 00 ┊ 10 20 00 b0 06 00 00 00 │• ⋄×2•⋄⋄┊• ⋄ו⋄⋄⋄│
│000004e0│ 04 20 00 b0 27 00 00 00 ┊ aa 55 aa 55 01 00 00 00 │• ⋄×'⋄⋄⋄┊×U×U•⋄⋄⋄│

The bytes at 200h was is unexpected. (WBU) I found a reference in code https://github.com/OpenNuvoton/NUC980_NuWriter_CMD/blob/master/Serial.h#L285 but this struct is not used anywhere.

Can anybody tell me where am I wrong?

Side question: WBU stand for Winbond? TVN => reverse Nuvoton?

@ychuang3
Copy link
Contributor

pack.bin is still for NuWriter, not for dd.
It is strongly suggested to use NuWriter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants