capiman / lpc21isp

lpc21isp - Portable command line ISP for Philips LPC family and Analog Devices ADUC70xx
68 stars 57 forks source link

- control option fails in Linux #30

Open ahmetonat opened 1 year ago

ahmetonat commented 1 year ago

Firt of all, great piece of software for the LPC series. It works beautifully with LPC824 using buttons for Reset and Boot0. Thanks for writing it!

Doing: $ lpc21isp build/i2c_isr.hex -control /dev/ttyUSB0 115200 12000

This error comes up: ERROR: open() for /sys/class/gpio/gpio0/value failed, No such file or directory

Indeed, there is no /sys/class/gpio/gpio0, but /sys/class/gpio/gpiochip708 exists and it is created every time I plug in the serial converter. However, there is nothing called "value" in it.

Linux Ubuntu 20.04.6 LTS, FTDI232 extender with FT232RL (fairly sure it is genuine).

This seems like an abandoned project, but perhaps someone is at the other end of the line?

Thanks, Ahmet

ahmetonat commented 1 year ago

OK, it looks like I found the solution.

The code is configured to use SYSFS by default to control the GPIO lines. This is what caused the problem. The fix is to comment out the following #define statement: in the file: "lpc21isp.h" around line 68:

if defined(linux) && !defined(GPIO_RST) && !defined(GPIO_ISP)

define SYSFS_GPIO_SUPPORT

endif

All 3 lines can be commented out or just the center #define line.

It worked fine after that.

Hope this helps someone.

Ahmet