hp30b SAMBA questions



#2

Hello,

I've got a few questions about SAMBA and flashing a 30b:

1)

When you simply turn the calculator on, and connect the SAMBA software to it, it says "No valid processor ID found". Only when doing the erase, reset, etc..., procedure, it can connect to it and show the whole GUI of the SAMBA program.

Is there any method, to make it not give that error message and go into the GUI, *without* erasing the ROM of the calculator? I ask this so that I can test whether or not SAMBA 2.9 is properly working in Wine in Linux, in a non destructive way (it currently never seems to work). And also for writing a program that can flash it in C.

2)

How much different types of memory does the calculator have, and how much of these can be accessed with the flashing, and which not?

3)

Are there sequences of bytes or strings you can send to the calculator through RS232 such that it will respond at least some bytes back that I can check, again without erasing its ROM?

I'm currently not getting back bytes after sending certain sequences while I would expect it, and am not sure if it's due to the RS232 library I'm using or something else. It's probably an error in my code. But it'd be nice to be able to test basic sending and receiving of anything, no matter what, without erasing the ROM :)

Should the calculator be on or off for this?

4)

What is the meaning of the reset button? My current guess is that erase deletes ROM, reset deletes non volatile user memory... Is there a possibility that apart from deleting things, these buttons also set the calculator to certain states related to the RS232 connection?

5)

How much baudrate would the calculator prefer to have if you connect to it?

Thanks!


Edited: 28 Aug 2011, 7:55 p.m.


#3

Lode,

Many questions some of which are best answered by going to the Atmel site and downloading the specification documents for the AT91SAM7L128 chip. There is a chapter about SAM-BA. I'll do my best anyway.

Quote:
1)

When you simply turn the calculator on, and connect the SAMBA software to it, it says "No valid processor ID found". Only when doing the erase, reset, etc..., procedure, it can connect to it and show the whole GUI of the SAMBA program.

Is there any method, to make it not give that error message and go into the GUI, *without* erasing the ROM of the calculator? I ask this so that I can test whether or not SAMBA 2.9 is properly working in Wine in Linux, in a non destructive way (it currently never seems to work). And also for writing a program that can flash it in C.


No, because the GUI only works after having sent a small program to the device to which it then talks. It's kind of a boot strap mechanism. The boot ROM with a limited command set is activated through resetting a single bit in the processor called GPNVM1. The Erase button not only clears the flash memory, it also resets the bit which makes SAM-BA start on the next power cycle or reset. What I've included in the WP 34S firmware is a means of clearing GPNVM1 by the software without erasing the hole flash area. This will start SAM-BA on the next power on and will allow to read out the flash from the GUI. The original firmware does not offer this possibility and therefore needs Erase to get into SAM-BA boot mode.

Quote:
2)

How much different types of memory does the calculator have, and how much of these can be accessed with the flashing, and which not?


The little RAM in the machine is used by SAM-BA for the boot strap software which is downloaded when the GUI starts up. So RAM is always overridden. You can only read the flash memory at 100000 and the SAM-BA ROM at 400000. The memory mapped setup registers should be readable, too. The only writable memory is flash. SAM-BA can set the status of GPNVM1 which is necessary to boot to the newly downloaded flash image.

Quote:
3)

Are there sequences of bytes or strings you can send to the calculator through RS232 such that it will respond at least some bytes back that I can check, again without erasing its ROM?

I'm currently not getting back bytes after sending certain sequences while I would expect it, and am not sure if it's due to the RS232 library I'm using or something else. It's probably an error in my code. But it'd be nice to be able to test basic sending and receiving of anything, no matter what, without erasing the ROM :)

Should the calculator be on or off for this?


Read the Atmel documentation for details. SAM-BA uses a baud rate tuning loop because the RC oscillators do not provide a reliable timing source. The tuning loop at the beginning of the connection between the GUI and the device modifies the processor clock until the data can be reliably transmitted back and forth.

Of course nothing will happen with the chip powered down.

Quote:
4)

What is the meaning of the reset button? My current guess is that erase deletes ROM, reset deletes non volatile user memory... Is there a possibility that apart from deleting things, these buttons also set the calculator to certain states related to the RS232 connection?


Erase erases flash and resets GPNVM1 as already stated. Reset restarts the firmware currently active. With GPNVM1 reset this is SAM-BA, otherwise the flash image is started.

Serial I/O needs to be programmed by the application running. WP 34S has some commands for this.

Quote:
5)

How much baudrate would the calculator prefer to have if you connect to it?


SAM-BA runs at 115 kbaud while WP 34S does its transmissions at 9600 baud.

#4

Cool, I found the spec and it mentions which characters to send and receive, that's helpful, thanks a lot!


#5

There is a python implementation of Sam-Ba, designed for CDC, for AT92SAM7S controllers, Sam I Am, with a GNU license. Had up to now no success to get it working with serial SAM-BA.

I am able to communicate with SAM-BA manually (e.g. with minicom on Linux), thru a FTDI USB-to-serial converter. There are issues with some Linux Kernel versions, see e.g. Linux4SAM.

Have not yet managed to get SAM-BA working with wine. Hope you have more success.

Hubert

Edited: 29 Aug 2011, 11:32 a.m.


#6

The RS232 library I'm using, is this one:

http://www.teuniz.net/RS-232/

Somewhere in a forum about this library, it was mentioned that it should work with a FTDI USB-to-serial converter, because the operating system abtracts it for you, it presents it as a virtual COM port.

I'm testing with an actual hardware COM port on my PC though, which is /dev/ttyS0 (and which would called COM1 in Windows).

In wine, as long as I give regular user permissions to /dev/ttyS0, it shows up as COM1 in the dropdown in the SAMBA 2.9 application. However, even with the calculator fully erased and ready to be flashed, it always gives the "No valid processor ID found" error in wine.

EDIT: on a later attempt it worked with wine. Seems like pressing reset and on one more time can help (in addition to the reset and on the flashing instructions for windows end with).


Edited: 29 Aug 2011, 7:44 p.m.


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP30b cable I can borrow? eri 7 948 11-10-2013, 07:55 PM
Last Post: Paul Berger (Canada)
  help flashing a hp30b to a wp34s john mantooth 3 560 09-25-2013, 08:58 AM
Last Post: Thomas Chrapkiewicz
  JTAG cable for HP30B? John Ioannidis 2 469 07-01-2013, 02:16 PM
Last Post: John Ioannidis
  HP30b to WP34S keyboard pretreatment Neil Hamilton (Ottawa) 4 567 12-15-2012, 01:13 PM
Last Post: Neil Hamilton (Ottawa)
  HP30b bugs? Che 27 2,191 11-06-2012, 07:46 PM
Last Post: Matt Agajanian
  Question to Eric Rechlin & Gene Wright about HP30b/30b repurposing at HHC2012 Namir 2 398 08-04-2012, 05:30 PM
Last Post: Namir
  Link for SAMBA v2.10 download Tom Sauntry 9 876 05-28-2012, 11:41 AM
Last Post: Tom Sauntry
  Flashing of WP34S, entering SamBa via keyboard Harald 4 511 05-06-2012, 02:17 PM
Last Post: Harald
  HP30b design choices David Griffith 1 339 02-13-2012, 06:41 PM
Last Post: Tim Wessman
  MySamba/Samba does NOT work with Vista - Problems again Eddie W. Shore 10 874 10-28-2011, 08:28 AM
Last Post: Marcus von Cube, Germany

Forum Jump: