Project

General

Profile

resolved: starting exploring the Jeenode Zero (upload not working)

Added by Rolf 2 months ago

It arrived yesterday! Following the instructions in the wiki (http://jeelabs.org/article/1651c/), the C-version, everything was easy and straight forward. First obstacle, the upload does not work. This is what I see:

Connected to: /dev/ttyUSB0
File: blink.bin
Count: 568 bytes
Checksum: b1dc0e80 hex
Synchronise: ............................................

That's what I did: Host: PC/Suse Linux, binary version of folie, the commands have to be transferred on the command line:
folie -p /dev/ttyUSB0 -b 115200 -u blink.bin
I tried baudrates 115200, 57600, 9600, the same result. What may be the problem? Is the bootloader missing?
Additional information: Connected the JNZ via USB-Bub, no modifications, the red LED on the JNZ is on, so the polarity seems to be OK.

Thanks for help,

Rolf

p.s.: I am not sure, is this the appropriate place to give feedback concerning the Jeenode Zero?


Replies (30)

RE: starting exploring the Jeenode Zero (upload not working) - Added by jcw 2 months ago

What kind of serial USB interface are you using?

The dots mean that the JNZ has not entered boot mode: BOOT0 = 1 and RESET pulsed low. Those two pins are on the FTDI header (pins 2 & 6 respectively, where GND is pin 1).

Also, you've ended up with Folie v1 - there's a completely rewritten Folie v2 in a separate repository. V2 does uploads by typing !u <file> as command, i.s.o. via the cmd line. Hm, maybe I should remove the v1 release files from the embello area?

RE: starting exploring the Jeenode Zero (upload not working) - Added by jcw 2 months ago

To follow up: yes, JNZ issues are most welcome here :)

One more note about Folie v2: without SerPlus, you have to give it -r to stay in "raw" mode (not Telnet).

The red LED is set by Forth, so that's probably pre-loaded onto the JNZ. When you type a return, do you see an "ok." prompt coming back? That would be a quick check that power and RX/TX are ok.

The boot loader on STM32 chips is in ROM. It's set at the factory, is always present and can't be messed up.

RE: starting exploring the Jeenode Zero (upload not working) - Added by Rolf 2 months ago

Jean-Claude,
thanks a lot for your quick answer. Yes, I see an "OK" prompt on "return". Shall try your other advices now.
Rolf

RE: starting exploring the Jeenode Zero (upload not working) - Added by Rolf 2 months ago

The USB-interface is USB BUB II from Modern device. Pins 2 and 6 are labeled CTS and DTR resp., so looks like this is appropriate.

RE: starting exploring the Jeenode Zero (upload not working) - Added by jcw 2 months ago

Aha - no: RTS ≠ CTS, you need a modified BUB - see this article for an explanation.

RE: starting exploring the Jeenode Zero (upload not working) - Added by Rolf 2 months ago

Thanks a lot for the advice. I modified the USB-BUB II (I bought it from Jeelabs shop, so it should be a regular device) as decribed, RTS to CTS and C4 shortcut, but still not working. But let me describe in detail, perhabs that's helpful. When I connect with an unmodified USB-BUB II, without (!) trying an upload, the red LED on the JNZ stays on and I get in contact with a forth interpreter, which is obviously preinstalled (great!). Upload not working, as it should be (as described above).

Now when I try with the modified BUB, the LED goes out at the moment when I start folie. And, first try again without upload, I have no contact to forth. Next try, upload, does not work as well.

I am still stuck on folie V1 and shall try to install V2 now. But it's strange that the contact to the forth does not work any more. The modified BUB is not detroyed during my soldering exercises, so far that it still works with the classic Jeenode (AVR).

RE: starting exploring the Jeenode Zero (upload not working) - Added by martynj 2 months ago

Could you post a photo of the modified BUB II ?

RE: starting exploring the Jeenode Zero (upload not working) - Added by JohnO 2 months ago

Don't forget "folie -r" when using a BUB.

RE: starting exploring the Jeenode Zero (upload not working) - Added by jcw 2 months ago

Ah, I'm sorry - I may have led you astray here ...

The DTR/RTS toggling is to get into ROM upload mode. Stick to Folie v1, please - it is able to toggle the pins by itself. Folie v2 needs SerPlus and the Telnet protocol to accomplish the same thing - v2 won't work with modified BUB (yet, I hope).

My confusion is due to LPC8xx vs STM32 differences: boot mode needs RTS high for STM32 and low for LPC8xx.

Long term, for JNZ use, your best bet is perhaps creating a SerPlus - but that has its own chicken-and-egg issue, since you'll need to load the SerPlus firmware into it as well.

The modified BUB is fine, but the RTS functionality is not right yet. The quickest way might be to create a little programming adapter like this:

Insert it while programming and remove it afterwards. Tedious, but at least it'll let you re-flash a JNZ with a BUB.

More convenient would be a slide switch (and perhaps also a reset button pulling DTR down, while you're at it).

I will need to revisit this soon, and will try to come up with a better way to upload for people don't use the SerPlus. My hope is that the go-serial library used in Folie v2 will have progressed enough that I can start toggling DTR and RTS from Folie v2 itself (the tricky bit is that this code needs to work across several OS'es).

DSC_5682.jpg (70.6 KB)

RE: starting exploring the Jeenode Zero (upload not working) - Added by jcw 2 months ago

JohnO wrote:

Don't forget "folie -r" when using a BUB.

Indeed, but that's only with Folie v2.

RE: starting exploring the Jeenode Zero (upload not working) - Added by jcw 2 months ago

To clarify: while plugged in with that adapter, the JNZ will be forced into ROM boot mode.
While not, it'll be in normal startup mode. Any USB serial, even just RX/TX & power should work.

Btw, that adapter also works with Folie v2 - I do recommend trying that as well. There's no further development on v1.

RE: starting exploring the Jeenode Zero (upload not working) - Added by Rolf 2 months ago

Thanks, Jean Claude, for the detailed description. A lot to learn, and not easy, because the overview is still missing for me. I think I'll start trying to find out that SerPlus thing. An upload is not that important at the moment. The blink example is just good to certify that the JNZ works, and that I know meanwhile, the forth interpreter told me.

RE: starting exploring the Jeenode Zero (upload not working) - Added by Rolf 2 months ago

Just to report some progress ("with a little help from my friends" it's easy): I soldered the SerPlus hardware with a "blue pill", including a crossover interface, between SerPlus and USB BUB II, and uploaded serplus.bin with folie (V1). It is easy and straight forward, as described in the Wiki (just collect the appropriate links). As I understood, this SerPlus-tool shall be my new serial interface (instead of USB BUB II) to upload files to the JNZ.

A question: How to connect the the SerPlus with my PC, via the micro-USB connector of the blue pill?

Though my traditional programming language is C, I shall explore Forth first.

RE: starting exploring the Jeenode Zero (upload not working) - Added by JohnO 2 months ago

Spot on: via the micro-USB connector of the blue pill and folie - not sure if you need folie 2.

RE: starting exploring the Jeenode Zero (upload not working) - Added by Rolf 2 months ago

Still a problem. Uploaded serplus.bin to the blue pill (jumper set for boot mode - upload - jumper back for run mode), This worked well, both with folie-v1 and folie-v2 -r). When I connect now the blue pill with the PC via USB-Micro, there is no serial interface to appear (it should be /dev/ttyUSB0 on Linux). It seams serplus does not work. Do I have to upload something else?

RE: starting exploring the Jeenode Zero (upload not working) - Added by JohnO 2 months ago

I take it you have reset the Blue Pill after loading up serplus.bin. Does anything appear in dmesg ?

RE: starting exploring the Jeenode Zero (upload not working) - Added by jcw 2 months ago

On Linux, the SerPlus should show up as /dev/ttyACM0 - not so?

RE: starting exploring the Jeenode Zero (upload not working) - Added by Rolf 2 months ago

No, nothing, no /dev/ttyACM0 or similar, no message in dmesg. Red LED on the blue pill is on - Ooohhh, bullshit, I just recognized that the USB/Micro-USB-cable was one that I got with a 5V power supply, may be data wires not connected. Took another cable, and it works, folie connects to /dev/ttyACM0!

Thank you guys and sorry for the confusion.

RE: starting exploring the Jeenode Zero (upload not working) - Added by Rolf 2 months ago

Did I detroy the JNZ, i.e. flashed Mescript? After trying this:
!s board.fs
JNZ does not react properly any more. The red LED does not go on, when connected and when I try to get in contact via folie, I just see:
Unhandled Interrupt 00000003 !
Unhandled Interrupt 00000003 !
Unhandled Interrupt 00000003 !
Unhandled Interrupt 00000003 !
Unhandled Interrupt 00000003 !
Unhandled Interrupt 00000003 !
...
...
...

RE: starting exploring the Jeenode Zero (upload not working) - Added by JohnO 2 months ago

Did you send the JNZ version or perhaps the Blue Pill version?

You need to reflash the JNZ, I think "!u 6" from folie 2 will do the trick.

RE: starting exploring the Jeenode Zero (upload not working) - Added by jcw 2 months ago

This indicates that flash contents after Mecrisp isn't right.

Which version of Mecrisp did you flash?

Best to use the ones from this area - it has small mods (see the spezial branch on GitHub for the source code). Most importantly, it has extra logic to make sure flash memory after Mecrisp itself is cleared on first launch.

Note that even with this constant output on startup, you can still reflash the unit with !u ....

RE: starting exploring the Jeenode Zero (upload not working) - Added by Rolf 2 months ago

I did not flash anything, the JNZ was in the state as delivered. Now I'm going to flash Mescript according to your advice.
Thanks a lot.

RE: starting exploring the Jeenode Zero (upload not working) - Added by jcw 2 months ago

Hm... I wonder how flash got corrupted.

Since you're using Folie v2 and the SerPlus, re-flashing can also be done with !u 6, as John mentioned.

RE: starting exploring the Jeenode Zero (upload not working) - Added by jcw 2 months ago

I noticed that the Folie binaries were not completely up to date.
Have updated it just now to v2.9 - see the releases page.
This one has Mecrisp 2.3.3 w/ "spezial" mods, the latest and greatest.

For JNZ, !u 6 is your friend:

These firmware images are built-in:
  1: F103-BMP         50096b  crc:F87A
  2: F103-Blink         724b  crc:4967
  3: F103-Mecrisp     20500b  crc:80FD
  4: F103-SerPlus      7052b  crc:7DD0
  5: L052-Blink         568b  crc:311E
  6: L052-Mecrisp     20500b  crc:B5A8
Use '!u <n>' to upload a specific one.
(1-25/30)