Dangerous Prototypes

Other projects => Past projects => Web platform => Topic started by: Markus Gritsch on March 06, 2010, 09:26:32 am

Title: Projects not working when flashed with a PIC programmer
Post by: Markus Gritsch on March 06, 2010, 09:26:32 am
Hi,

I posted a comment at the "introduction-to-dspic33-programming" page [1] but am reposting it here in the forum so that it does not get overlooked:

I think using 0b11 in the line
    _FICD(JTAGEN_OFF & 0b11);
is not correct. 0b11 is expanded to the 16 bit value 0b0000000000000011 which sets all other bits in FICD to zero. Better use ICS_PGD1 which is defined as 0xFFFF:
    _FICD(JTAGEN_OFF & ICS_PGD1)

This is *really an issue* when using a PIC programmer to program the firmware. It took me quite some time to figure out, why most of the examples do not work on the Web Platform when programmed with a programmer, but work fine when transferred using the bootloader. The bootloader seems to not program the config bits, at least not the bits in FICD, which hides the bug introduced when using & 0b11.

MCstackDemo MCstack-SDcard-server, and ds33Intro all contain this bug in either HardwareProfile.h or main.c. It should really be corrected in the SVN (and ideally also in the provides .zip files in the download section) to prevent others from stumbling over this issue.

I could do the work if I get SVN commit permissions assigned.

[1] http://dangerousprototypes.com/2010/02/ ... mment-2204 (http://dangerousprototypes.com/2010/02/04/web-platform-introduction-to-dspic33-programming/#comment-2204)
Title: Re: Projects not working when flashed with a PIC programmer
Post by: ian on March 06, 2010, 09:37:58 am
I added your gmail address. You'll need to look at your google code profile to get your google code password. Let me know if you need any other help with SVN.
Title: Re: Projects not working when flashed with a PIC programmer
Post by: Markus Gritsch on March 06, 2010, 10:38:24 am
Fixed in SVN.
Title: Re: Projects not working when flashed with a PIC programmer
Post by: ian on March 06, 2010, 11:10:28 am
Thanks Markus, I'll prepare a new release package and do a post about it.
Title: Re: Projects not working when flashed with a PIC programmer
Post by: Markus Gritsch on March 06, 2010, 01:53:33 pm
I checked in the .hex file of the ds33Intro project, but did not commit new versions of the .hex files for the MCstackDemo, MCstack-SDcard-server, and tweet_tree projects.

( ! ) 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.01002050088session_write_close ( )...(null):0
20.01032181664ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01032182440Database_MySQL->query( ).../DatabaseHandler.php:119
40.05682321160Database_MySQL->error( ).../Db-mysql.class.php:273