Problem with Motor Bridge Cape

Hello. I hope you had a pleasant Qingming Holiday.

I recently purchased several Motor Bridge Capes and BBGs as the core of a motor control solution. It seems that my setup is not working correctly. The BBG cannot seem to detect the ST coprocessor over the I2C interface. I followed your setup guide at seeedstudio.com/wiki/Motor_Bridge_Cape_v1.0. I have experience with I2C on BBB/Linux, but I am not sure how to proceed here. Help would be appreciated. Descriptions and images below. Thanks in advance.

Configuration:
-Motor Bridge Cape connected to BBG.
-Ethernet connected to BBG.
-DC power supply running @ 12V connected to Battery +/ screw blocks (see image).
-BBG running preloaded eMMC Debian Image 2015-10-20.
-MotorBridgeCapeforBBG_BBB python software installed (github.com/Seeed-Studio/MotorBr … forBBG_BBB).

Observations:
-BBG runs ok.
-PWR LED on Motor Bridge Cape is lit.
-MotorBridgeCapeforBBG_BBB python software shows error “Error accessing 0x4B: Check your I2C address” (see image).
-Linux command “i2cdetect -y -r 1” shows no device at 0x4B, or any other address (see image).

20160403_201457.jpg

20160403_201506.jpg

python.png

i2cdetect.png

It is also worth noting that I tried this with a second Motor Bridge Cape unit paired with a BBB (not a BBG) and saw the same result. It seems unlikely that I would have 2 faulty Motor Bridge Cape units? I must be missing something here?

I have one more unopened Motor Bridge Cape unit that I can test with. Thanks!

Hi,

Please try the following steps:

1, Connect cape to your BBG/BBB, download seeedstudio.com/wiki/images/ … e_v1.0.zip to your BBG/BBB
2, unzip the file
3, Goto the directory Motor Bridge Cape V1.0 (cd Motor Bridge Cape V1.0)
4, upload firmware (make flash_firmware)

Thanks, Xiangnan. Everything works after following your instructions to flash the co-processor firmware.

A few questions:

  1. Did the units ship without firmware, or with the wrong firmware? I ordered 3 of these from Digikey, and 2 of these have this problem. I will try the 3rd unit. I might suggest that you post these instructions in your product page for your customers.
  2. Do you make the source code for the co-processor firmware available?
  3. Is it possible to stack these capes to add more motor control channels. I realize that there would need to be a way to set the I2C address of each co-processor, and there is the issue of power.

Thanks,
Chris

Hi Chris,

Sorry for this problem and thanks for your feedback!

[b]for your question:[/b]
  1. We made a mistake in uploading the firmware and it leads to the problem you found.We will update the wiki to let you and other customers know how to solve this problem.

2.We will upload the source code soon.If you want it now, please share me your email address. If you find any other problem, please notify us. Thanks! :smiley:

3.There is a register(addr: 0X08) which is used for setting the I2C address. But it will be reset as 0X4B if the cape restarted( after you wrote one byte address into 0X08, you should change your I2C address and do not reset the cape). I have reviewed the source code and find that it will come into conflict with some commands.This has been solved in latest version.

Hello Fuhua. Thanks for the response.

I would like to take a look at the source code if possible. My email is cpendleton@ptcusa.com.

Regarding the I2C address, I don’t understand how that approach would work. If I stack the capes and they are both at address 0x4B on the same I2C bus, there will be an address conflict. How would I use the register setting to change only one of the cape boards?

Thanks,
Chris

    In the development process, i have not considered this stuiation(stack capes).I2C address changed just for interim use. But now, I have modified the source code to realize the function.

    once you change the I2C address, It will not be used immediately. You should send another command to save it into flash and restart the capes automatically. It will load the new address to initialize I2C. For the details, i will tell you via email. Please kindly check the email. And if you have other good advices, please share me. :smiley:

Getting the same error as OP, with very similar setup so far except using BBB and using Debian GNU/Linux 8 2016-01-24

When I try to flash the firmware using (make flash_firmware) I get an error though. I’m relatively new with BBB, so I’m not sure if there are other ways to ‘flash the firmware.’

Thanks in advance.

EDIT: I have tried using chmod a+x to give me permission to execute, and then came across a problem with dev/tty02 in the flasher, which I changed to dev/tty2 (to match what was in my /dev list), but still no luck in successfully flashing the firmware.
BBB motor cape error.JPG

Hi,

Did your BBB boot with the latest system image from BeagleBone forum?
If so, you have to enable the Serial port 2. It was not enabled by default.

To enable serial port 2, add a line with “cape_enable=bone_capemgr.enable_partno=BB-UART2” to /boot/uEnv.txt and reboot your device. Change the port back to dev/ttyO2 in flasher file.

Hope this can solve your problem, Let me know if further detail/explanation would be helpful.

Hello,

I read what was available in this forum. I am getting an issue:

• Error accessing 0x4B: Check your I2C address

I have a MotorBridgeCape with a BBG. I attached two motors and a battery. I used the PuTTY to run my python program I got from the MotorBridge Wiki.

Do I need to update firmware for the MotorBridgeCape or allow the serial bus with python-smbus?

I am new to these issues and I need support.

Seth
silver2row on GitHub

P.S. If someone knows the answer, please try to contact me. Oh and here is a photograph/video. It is my PuTTY Terminal. I cannot access the .zip file once I unzipped it. Please provide support.

youtu.be/lqNmfVogOd8

Hello,

Thanks for the reply. I have tried adding it into the uEnv.txt file as you said, but still no luck in using “make flash_firmware”. I have added my output errors if they will help you understand my current situation. My Linux info is as follows: Linux beaglebone 3.8.13-bone79 #1 SMP Tue Oct 13 20:44:56 UTC 2015 armv7l GNU/Linux

EDIT (May 4th, 2016): I noticed a typo in enabling the Serial Port 2 with BB_UART2 and have now changed it to BB-UART2, but still can’t get it to work. I have tried both formats for 3.8 and 4.1 for enabling the Serial Port 2.

Thanks again in advance,
Alvin
output after using mv tty2 tty02.JPG
output using tty02 - fix.JPG
flasher tty02.JPG
ls dev tty2.JPG
port 2 enabled in uEnv.JPG

Hello silver1row,

Have you tried the commands mentioned earlier?

I can see you have the folder so try this from the directory shown in the video.

cd Motor\ Bridge\ Cape\ Firmware\ v1.0
make flash_firmware

Let me know if that works for you, as I am currently stuck in using “make flash_firmware” and having it work correctly.

Hello,

I found the flasher file in the .zip file I unzipped. Okay, now the tty02 is already listed in that specific location. Where do I go from here?

Seth

Please try the commands that were mentioned earlier. I believe you have already unzipped the file since I see a directory named Motor Bridge Cape Firmware in the video. Start by running the commands before changing anything else. I just followed those commands mentioned in the earlier post of this thread.

#cd Motor\ Bridge\ Cape\ Firmware\ 1.0
#make flash_firmware

Hello…I tried to run the cmd make flash_firmware after unzipping the .zip file. I got an error.

Seth

P.S. This is the error: root@beaglebone:~# make flash_firmware
make: *** No rule to make target ‘flash_firmware’. Stop.

Oh and if I run the cmd make flash_firmware in the unzipped .zip file, I get this error:

root@beaglebone:~/Motor Bridge Cape Firmware v1.0# make flash_firmware
make: *** No rule to make target ‘flash_firmware’. Stop.

Please see the attachments.

Seth
adafruit and I2C.JPG
adafruit and ADC.JPG

FIXED, I think.

The problem was on my end with the typos, but anyways, here is what I did to fix it.

I enabled BB-UART2 in my uEnv.txt file using commands given by qxn.c.
nano /boot/uEnv.txt

Add in the following:
#for v4.1.x
cape_enable=bone_capemgr.enable_partno=BB-UART2

#for v3.8.x
cape_enable=capemgr.enable_partno=BB-UART2

Next, check to see if it has been added by using the following:

(THIS IS THE LETTER ‘O’ NOT THE NUMBER ‘0’ WHICH WAS MY MISTAKE)
ls -l /dev/ttyO*

Output should show:
/dev/ttyO0
/dev/ttyO2

Then just went back to following the main instruction of flashing the firmware by going to the directory and using:
make flash_firmware.

Hope this helps others having the similar problem. Thanks for the help other forum users.

-Alvin
flashing worked p2.JPG
flashing worked p1.JPG
check for ttyO2.JPG

Alvin,

 I found that you have already fixed the issues.  The solving steps of the "Motor Bridge Cape firmware issue" is updated to the wiki page [seeedstudio.com/wiki/Motor_Bridge_Cape_v1.0](http://www.seeedstudio.com/wiki/Motor_Bridge_Cape_v1.0) .

Thank you for your sharing.

Hello,

Thank you. I am going to check this correction soon. Thank you for updating the info. so far.

An “O” and not a zero. Ha! Fooled me too.

Seth

Hello,

I got the motor turning. Things are working so far. Thank you, again.

Seth