DMCP_SDK Hello World

This is where developers can exchange ideas and ask questions relevant to the DM42 firmware.

Please note that Swiss Micros staff are unable to provide answers here as a general rule. This is intended as a community-driven forum.
User avatar
Vitasam
Posts: 217
Joined: Thu Jun 01, 2017 9:51 am
Location: Finland
Contact:

Re: DMCP_SDK Hello World

Post by Vitasam » Fri Jun 15, 2018 12:04 pm

Thomas_ER wrote:
Fri Jun 15, 2018 11:39 am
Vitasam wrote:
Fri Jun 15, 2018 11:12 am
Thomas_ER wrote:
Fri Jun 15, 2018 10:53 am
Hi Vitasam,
...
Hi Thomas,

in which Windows terminal you are running make? Cygwin or something similar? There is a shell message
/usr/bin/sh: bin/check_qspi_crc: No such file or directory

I did test it just in Windows terminal (cmd)
I did it also in Windows terminal cmd, no Cygwin.

Now i moved the Github-Content from the MinGW directory to my users directory,
did am 'make clean', and another 'make', but i get the same error.

Found some hints regarding '/usr/bin/sh' at
https://stackoverflow.com/questions/478 ... on-windows,
but this didn't help.
Well, this is exactly the thing, which makes using of Linux machines much easier for embedded software development.

Did you check your PATH Windows environment variable, does it have usr/bin somewhere?
I don't use WIndows PC for embedded SW development, so I'm afraid that I have no idea how to fix.

But in any case tools from /bin folder should be updated to work in Windows, so that is another challenge
Elektronika MK-61, Elektronika MK-52, HP15c LE, DM42 SN#16 FW 3.11

Thomas_ER
Posts: 64
Joined: Mon Jul 24, 2017 1:19 pm
Location: Germany

Re: DMCP_SDK Hello World

Post by Thomas_ER » Fri Jun 15, 2018 1:19 pm

I got it. Now:

Code: Select all

...
arm-none-eabi-objcopy --remove-section .qspi -O ihex    build/TESTPGM.elf  build/TESTPGM_flash.hex
arm-none-eabi-objcopy --remove-section .qspi -O binary  build/TESTPGM.elf  build/TESTPGM_flash.bin
arm-none-eabi-objcopy --only-section   .qspi -O ihex    build/TESTPGM.elf  build/TESTPGM_qspi.hex
arm-none-eabi-objcopy --only-section   .qspi -O binary  build/TESTPGM.elf  build/TESTPGM_qspi.bin
bin/check_qspi_crc TESTPGM src/qspi_crc.h || ( make clean && false )
bin/add_pgm_chsum build/TESTPGM_flash.bin build/TESTPGM.pgm
SHA1: 7bc642c6b3c6bb62cb5eadc28ba9761f6b93013b*
arm-none-eabi-size build/TESTPGM.elf
   text    data     bss     dec     hex filename
    752    1088      64    1904     770 build/TESTPGM.elf

C:\Users\Thomas\DM\DMCP_SDK>
There had been 'WinAVR-20100110\' in the path (but no usr/bin !), containing also some Unix-style commands.
For testing I changed your 'setenv.bat' temporarely to

Code: Select all

set PATH=C:\MinGW\msys\1.0\bin;C:\Program Files (x86)\GNU Tools ARM Embedded\7 2017-q4-major\bin;%PATH%;

Again many thanks for your help!
[ HP48/49/50/42S/WP34/HP Prime/ DM42 (#00185+00318) ]

User avatar
Vitasam
Posts: 217
Joined: Thu Jun 01, 2017 9:51 am
Location: Finland
Contact:

Re: DMCP_SDK Hello World

Post by Vitasam » Fri Jun 15, 2018 1:43 pm

Thomas_ER wrote:
Fri Jun 15, 2018 1:19 pm
I got it
Ok good! Did you try the .pgm file in real DM42? In my case the hash check was failed
Elektronika MK-61, Elektronika MK-52, HP15c LE, DM42 SN#16 FW 3.11

Thomas_ER
Posts: 64
Joined: Mon Jul 24, 2017 1:19 pm
Location: Germany

Re: DMCP_SDK Hello World

Post by Thomas_ER » Fri Jun 15, 2018 2:36 pm

Vitasam wrote:
Fri Jun 15, 2018 1:43 pm
...
Ok good! Did you try the .pgm file in real DM42? In my case the hash check was failed
.. not yet (I'm too cautious).
Did you compare the binaries from Linux vs. Windows?
[ HP48/49/50/42S/WP34/HP Prime/ DM42 (#00185+00318) ]

User avatar
Vitasam
Posts: 217
Joined: Thu Jun 01, 2017 9:51 am
Location: Finland
Contact:

Re: DMCP_SDK Hello World

Post by Vitasam » Fri Jun 15, 2018 3:00 pm

Thomas_ER wrote:
Fri Jun 15, 2018 2:36 pm
Vitasam wrote:
Fri Jun 15, 2018 1:43 pm
...
Ok good! Did you try the .pgm file in real DM42? In my case the hash check was failed
.. not yet (I'm too cautious).
Did you compare the binaries from Linux vs. Windows?
Nope. And I don't have windows binary anymore (they are on other Windows PC). If you drop it (e.g. as attached zip) I can compare with linux version.
Elektronika MK-61, Elektronika MK-52, HP15c LE, DM42 SN#16 FW 3.11

Thomas_ER
Posts: 64
Joined: Mon Jul 24, 2017 1:19 pm
Location: Germany

Re: DMCP_SDK Hello World

Post by Thomas_ER » Fri Jun 15, 2018 3:32 pm

Vitasam wrote:
Fri Jun 15, 2018 3:00 pm
Thomas_ER wrote:
Fri Jun 15, 2018 2:36 pm
...
Nope. And I don't have windows binary anymore (they are on other Windows PC). If you drop it (e.g. as attached zip) I can compare with linux version.
here it is (all TESTPGM.* files)
Attachments
build.zip
(16.15 KiB) Downloaded 19 times
[ HP48/49/50/42S/WP34/HP Prime/ DM42 (#00185+00318) ]

User avatar
Vitasam
Posts: 217
Joined: Thu Jun 01, 2017 9:51 am
Location: Finland
Contact:

Re: DMCP_SDK Hello World

Post by Vitasam » Fri Jun 15, 2018 4:42 pm

Thomas_ER wrote:
Fri Jun 15, 2018 3:32 pm
here it is (all TESTPGM.* files)
.pgm files are different in size:

Code: Select all

$ diff -s build_linux/TESTPGM.pgm build_win/TESTPGM.pgm 
Binary files build_linux/TESTPGM.pgm and build_win/TESTPGM.pgm differ

$ ls -l build_win/TESTPGM.pgm  build_linux/TESTPGM.pgm 
-rw-rw-r-- 1 vitali vitali 1916 kesä  15 19:34 build_linux/TESTPGM.pgm
-rw-rw-r-- 1 vitali vitali 1861 kesä  15 16:11 build_win/TESTPGM.pgm
But both binaries started Ok in my DM42 (I modified code a little bit in linux build):
Attachments
windows_build.png
Windows build
windows_build.png (4.48 KiB) Viewed 592 times
linux_run.png
Linux run
linux_run.png (1.96 KiB) Viewed 592 times
linux_build.png
Linux build
linux_build.png (4.46 KiB) Viewed 592 times
Elektronika MK-61, Elektronika MK-52, HP15c LE, DM42 SN#16 FW 3.11

Thomas_ER
Posts: 64
Joined: Mon Jul 24, 2017 1:19 pm
Location: Germany

Re: DMCP_SDK Hello World

Post by Thomas_ER » Fri Jun 15, 2018 8:03 pm

Hello Vitasam,

many thanks for checking this!
It is reassuring that both files are executable.
Also interesting, that the sizes reported by the DM42 also differ from the sizes within Linux (ls).

Thomas
[ HP48/49/50/42S/WP34/HP Prime/ DM42 (#00185+00318) ]

rprosperi
Posts: 380
Joined: Mon Apr 24, 2017 5:48 pm
Location: New York

Re: DMCP_SDK Hello World

Post by rprosperi » Sat Jun 16, 2018 1:30 am

Thomas_ER wrote:
Fri Jun 15, 2018 8:03 pm
Hello Vitasam,

many thanks for checking this!
It is reassuring that both files are executable.
Also interesting, that the sizes reported by the DM42 also differ from the sizes within Linux (ls).

Thomas
Building images from the same sources using gcc running on Linux and Windows producing different binary results does not necessarily mean something is configured wrong on one of those platforms, gcc has done this since the mid-90's at least. I'd guess it's differences in the libraries, but never found answers (after a lot of looking) but in the end, both images worked OK.
--bob p

DM42: β00071 & 00282

Thomas_ER
Posts: 64
Joined: Mon Jul 24, 2017 1:19 pm
Location: Germany

Re: DMCP_SDK Hello World

Post by Thomas_ER » Sat Jun 16, 2018 9:33 am

rprosperi wrote:
Sat Jun 16, 2018 1:30 am
Thomas_ER wrote:
Fri Jun 15, 2018 8:03 pm
Hello Vitasam,

many thanks for checking this!
It is reassuring that both files are executable.
Also interesting, that the sizes reported by the DM42 also differ from the sizes within Linux (ls).

Thomas
Building images from the same sources using gcc running on Linux and Windows producing different binary results does not necessarily mean something is configured wrong on one of those platforms, gcc has done this since the mid-90's at least. I'd guess it's differences in the libraries, but never found answers (after a lot of looking) but in the end, both images worked OK.
Thanks for the background information!
Ultimately, it is crucial that the images are executable.

Some more hints for recommended working envorinments (e.g. from David and/or Michael) are very welcome!
[ HP48/49/50/42S/WP34/HP Prime/ DM42 (#00185+00318) ]

Post Reply