Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Development => Topic started by: perillamint on October 06, 2015, 07:00:20 am

Title: How to contribute BPv4 development? (+ some bugfix)
Post by: perillamint on October 06, 2015, 07:00:20 am
Hello everyone!

I found some bugs around in Bus Pirate v4 code and want to send patch for it.

First, It does not compile using MPLABX IDE. I searched forum a bit and heard that file is quite old.
So, I tried to fix file paths in project config and successfully managed to build 6.3-beta firmware.

Here is a diff of that fix.
https://github.com/perillamint/bus_pira ... 9425660806 (https://github.com/perillamint/bus_pirate/commit/fcbd09ea01e09e549d21e2c5c048e49425660806)

Additionally, BPv4 gives false positive "Buffer overflow warning". I searched code a bit, and I found that warning is produced by this code.
https://github.com/perillamint/bus_pira ... ART.c#L262 (https://github.com/perillamint/bus_pirate/blob/6e0c5f7c5ad58ab602c4163d85634819755ed425/Firmware/UART.c#L262)

Although this code works well on BPv3, which uses FTDI and UART to communicate with PC, BPv4 does not use FTDI and UART for communicating with PC. So warning criteria (U2BRG<U1BRG) will be always true. (BPv4 does not uses U2BRG)

I want to fix this but I don't have programming experience with PIC24, I don't know how to fix this false positive warning right now. (To fix this, I need to find which register provides USB baud rate and use it instead of U2BRG)

**EDIT:
patch:
https://github.com/perillamint/bus_pira ... d9e4415c58 (https://github.com/perillamint/bus_pirate/commit/f35e1985dc4d0a739673cf334c989fd9e4415c58)
I think this patch is enough. Since there are no "Baud rate" stuff exist in USB CDC and since USB CDC is fast enough then UART communication, disabling it when it is not in debug mode(debug mode uses AUX0,1 as UART port to communicate with PC)


Additionally, DP google code repository goes read only due to googles decision. Is there any other live public SVN repository?

p.s. Sorry for my poor English. (I'm not native English speaker)
Title: Re: How to contribute BPv4 development? (+ some bugfix)
Post by: tayken on October 06, 2015, 04:37:27 pm
Thanks a lot for bugfixes. DP repo moved to github as far as I know so I believe you can access it over there.

Yeah, MPLAB IDE is dead, I did the switch mostly but keeping IDE for DP related stuff. I'm sure Ian will catch up soon. :)

Note: Deleted the previous post.
Title: Re: How to contribute BPv4 development? (+ some bugfix)
Post by: perillamint on October 07, 2015, 07:37:13 pm
Ok. I made pull request ( https://github.com/DangerousPrototypes/ ... ate/pull/1 (https://github.com/DangerousPrototypes/Bus_Pirate/pull/1) ) and accepted. Thanks!

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01022059560session_write_close ( )...(null):0
20.01052191152ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01052191928Database_MySQL->query( ).../DatabaseHandler.php:119
40.05532330664Database_MySQL->error( ).../Db-mysql.class.php:273