Canot set pin as output

More
26 Dec 2016 20:27 #84711 by yaqwsx
I created a custom firmware for Mesa 5i24/6i24 based on existing ones, so I could have a single servo and 5 stepgens with a reasonable pinout. There is no problem with loading the firmware to PnCConf (I can see correct pinout and assign functions to modules and pins), however when I try to run LinuxCNC with generated configuration, it fails, because there is a missing parameter is_output for some pins. These pins shouldn't be assigned to any module and therefore, they should have this parameter. I inspected the hm_5i24 module and there are GPIO pins, which doesn't have this parameter. I haven't found any rule - they seem random - e.g. pins 7, 9, 11, 25, 30, 31, 48, 49.

What could be wrong?

My sources for the firmware can be found here:
pastebin.com/mLVY5qhq
pastebin.com/9eqWfWR6

Please Log in or Create an account to join the conversation.

More
27 Dec 2016 13:23 #84742 by yaqwsx
Replied by yaqwsx on topic Canot set pin as output
Ok, I finally found the problem - it is not in PnCConf. The problem is in my custom firmware - resulting firmware has different pinout from which I expected. This is strange to me - I have problem to find out what might be wrong with the source code. The synthesis runs fine with no errors, the firmware seems to be accepted by the card, it just has a different pinout - there are extra GPIO pins in between pins connected to modules.

What am I doing wrong? Here's my PIN file and a log showing the real pinout:
PIN: pastebin.com/93axsrXV
Pinout: pastebin.com/jkhSt3t6

Please Log in or Create an account to join the conversation.

More
27 Dec 2016 19:21 #84762 by PCW
Replied by PCW on topic Canot set pin as output
That's pretty weird, let me try building that config here and see what I get

Please Log in or Create an account to join the conversation.

More
27 Dec 2016 21:38 #84764 by yaqwsx
Replied by yaqwsx on topic Canot set pin as output
Problem solved. It was my stupidity - after flashing new firmware to EEPROM, it is necessary to completely shut-down the PC, ordinary reboot is not sufficient to make the changes visible.

Please Log in or Create an account to join the conversation.

More
27 Dec 2016 23:37 #84776 by PCW
Replied by PCW on topic Canot set pin as output
Ahh yes you need to make sure you are running the expected firmware or you will end up going in circles

Note that you can also load new firmware by using the --reload option of mesaflash after writing the new firmware:

sudo mesaflash --device 5i24 --reload

Please Log in or Create an account to join the conversation.

More
27 Dec 2016 23:40 #84777 by yaqwsx
Replied by yaqwsx on topic Canot set pin as output
The --reload options was not working for me. Only the full shutdown helped.

Please Log in or Create an account to join the conversation.

More
28 Dec 2016 00:13 #84779 by PCW
Replied by PCW on topic Canot set pin as output
Just checked, reload works fine here

Is it possible you built your bitfile with older source code so you dont have have the reload option?

Please Log in or Create an account to join the conversation.

More
29 Dec 2016 17:05 #84858 by yaqwsx
Replied by yaqwsx on topic Canot set pin as output
I've tried it once more - --reaload isn't supported for 6i24 (mesaflash gives this as error message).

However I run into another issue. When I configure a GPIO as an output, the physical pin is always high (I can measure 5V) no matter what is set in HAL (Halmeter shows expected pin values). What could be wrong?

Please Log in or Create an account to join the conversation.

More
29 Dec 2016 17:28 #84859 by PCW
Replied by PCW on topic Canot set pin as output
Possible errors:

Wrong physical pin (verify pin as input, ground to test)

Error in bitfile (does a standard supplied 5i24 bitfile work?)

On mesaflash I didn't try 6I24 since all standard config files are for 5I24
(try --reload with a standard 5i24 bitfile, works for me)

Please Log in or Create an account to join the conversation.

More
29 Dec 2016 17:47 #84861 by yaqwsx
Replied by yaqwsx on topic Canot set pin as output
I program 6i24 as 5i24. Issuing "sudo mesaflash --device 5i24 --reload" does not work: "ERROR: FPGA reload not supported".

I am pretty sure I have the right pin. Even if I try unmodified firmware (but compiled by myself) - e.g. SVST2_8_72 it behaves the same. Is it possible to download precompiled firmware? I only found firmwares supplied by Mesa, however all of them are meant to be used with their breakout boards.

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.102 seconds
Powered by Kunena Forum