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

netx90 flashing via UART #9

Open
qtphan734 opened this issue Sep 24, 2019 · 2 comments
Open

netx90 flashing via UART #9

qtphan734 opened this issue Sep 24, 2019 · 2 comments

Comments

@qtphan734
Copy link

Hi,

This is more of a question than an issue.

I have a NXHX 90-JTAG development board. I would like to flash the netx90 via UART (X902 header on the dev board). In my current setup, I have an RS232 to TTL 3.3V converter hooked up to the X902 pins accordingly:

  • TTL3V3_TXD <==> X902_RXD_Pin2
  • TTL3V3_RXD <==> X902_TXD_Pin1
  • TTL3V3_CTS <==> X902_RTS_Pin3
  • TTL3V3_RTS <==> X902_CTS_Pin4
  • TTL3V3_GND <==> X902_GND_Pin5

I have also enable console mode (S400 pin 5 ON) and enable flashing via UART (S701 Pin 2 ON).

The document I am following is the netx90 production guide. The production guide says version 1.5.4 does not support flashing via UART yet. However, I see that there is a v1.5.5 that was tested against netx90 on Ubuntu via UART.

The netx90 production guide says to execute the following command to show the busses and units that are available.

lua5.1 cli_flash.lua info

I am getting the following error message when I try to select the UART interface (eg. romloader_uart_ttyUSB0):

Please select the interface:
1: romloader_uart_ttyS0 (romloader_uart) Used: false, Valid: true
2: romloader_uart_ttyUSB0 (romloader_uart) Used: false, Valid: true
3: romloader_jtag_netX90_COM@NXHX_90-JTAG@1:1 (romloader_jtag) Used: false, Valid: true
R: rescan
C: cancel
>2
[9] created
Close: m_fRxThreadIsRunning=0
[4] Failed to receive first char of knock response: 0.
Close: m_fRxThreadIsRunning=1
Close: m_fRxThreadIsRunning=0
Close: m_fRxThreadIsRunning=0
[8] released interface romloader_uart_ttyUSB0.
[8] deleted
./lua5.1: romloader_uart_ttyUSB0(0x5581d5ba8750): failed to identify loader!
stack traceback:
	[C]: in function 'Connect'
	cli_flash.lua:482: in function 'exec'
	cli_flash.lua:807: in main chunk
	[C]: ?
+romloader_jtag_provider::~romloader_jtag_provider()
-romloader_jtag_provider::~romloader_jtag_provider()
~romloader_usb_device_libusb

Is flashing via UART (X902 header on dev board) supported yet? If so, what steps am I missing or doing incorrectly? Please help.

Thanks in advance

@dizzydevil
Copy link
Contributor

dizzydevil commented Sep 25, 2019

Hi qtphan734,

is the SYS LED blinking when you try to flash via UART?
In the output you posted above, I see that you're connected to the USB-JTAG interface on the NXHX 90. If you access the board via JTAG, the CPU is halted. If you then try to talk to it via UART you get exactly the same behaviour and error message.
Reset or power-cycle the board and make sure that the SYS LED is blinking before you access it via UART.

Can you talk to the ROM console via a terminal program?
Set the terminal to 115200 Baud 8N1, put the netx 90 into console mode (SYS LED blinking yellow) and type
*#
and you should get the message "HBOOT netx90_full console".
(When you do this, you need to reset again before you try to flash via UART, because the flasher looks for the initial message that was printed to the terminal)

Do you need to use X902 or could you use the USB-COM port that's also on the mini USB port on the NXHX board?
Here's some instructions to set up the USB COM port on Ubuntu. (Forgive the weird formatting.)
Flasher - LINUX_ install NXHX90-JTAG with UART support via mini-USB-v10-20190925_1903.pdf

BTW, you don't need to connect RTS/CTS.

What operating system/version and what version of the flasher package are you using?

@qtphan734
Copy link
Author

Hi @dizzydevil,

I did not get to the flashing command yet as I was just executing the info command to get the bus information. Also, although the USB-JTAG is connected, I did not access the board via JTAG (.

Can you talk to the ROM console via a terminal program?

I was able to enter console mode via terminal program by sending *# from your instructions.

Do you need to use X902 or could you use the USB-COM port that's also on the mini USB port on the NXHX board?

We are planning to use UART to flash the firmware from our MCU, hence we are testing this method.

What operating system/version and what version of the flasher package are you using?

I tried version 1.5.4 (came with netX Studio) on Windows and version 1.5.5 on Ubuntu 18.04

When running the lua5.1 cli_flash.lua info command, below is the traffic I see coming out of the netX 90:
netx90_flash_capture

Reviewing the romloader_uart::identify_loader() function from https://github.com/muhkuh-sys/org.muhkuh.lua-romloader/blob/master/plugins/romloader/uart/romloader_uart_main.cpp, it does not seem the flasher tool support the above response from the netX 90.

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