Jump to content
Sign in to follow this  
thiemann

Boostc 1.7: Config Word Has The Wrong Value

Recommended Posts

Bug description:

The compiler is not generating the correct config word.

 

Steps to reproduce:

1.) Create a new project

2.) Add a main.c file to the project with the following code

#include <system.h>

#define DATA 0x2007, _CP_OFF & _DEBUG_OFF & _WRT_OFF & _CPD_OFF & _LVP_ON & _BODEN_ON & _PWRTE_ON & _WDT_OFF & _HS_OSC

void main()
{
    while (1)
    {

    }
}

3.) Compile and link the project using BoostC

4.) Check to see what the generated config word is (I do this by opening the hex file using the ICprog program).

5.) Notice that the generated configuration word is 0x3fff, which is incorrect.

 

Expected behavior:

The generated configuration word should be 0x3ff2.

 

Is the problem 100% reproducible:

Yes

 

SourceBoost version: 5.7

Compiler: BoostC

Compiler version: 1.7 Alpha

 

OS: Windows XP

 

Comments:

None

Share this post


Link to post
Share on other sites

Pavel, the target is the 16f876a, however, I found the problem, I was doing #define instead of #pragma for the config word, my bad. However, now that this is figured out, perhaps you can help me with the grand problem that I am having (which I first thought this config word was the reason for my grand problem).

 

Is there anything strange with the BoostC compiler that will not allow the code it generates to work with bootloaders? I know I asked you this before and you said there was a problem. Is the problem, or any other problems of this nature, resolved? I ask this because code that is generated by BoostC does not work when I use my bootloader (tiny boot loader) when the same code works when compiled with the C2C plus compiler.

 

For example, the following code when compiled with BoostC does not work when loaded using the bootloader.

#include <system.h>

#pragma CLOCK_FREQ 20000000
#pragma DATA 0x2007, _CP_OFF & _DEBUG_OFF & _WRT_OFF & _CPD_OFF & _LVP_ON & _BODEN_ON & _PWRTE_ON & _WDT_OFF & _HS_OSC

void main()
{
intcon = 0;
trisc = 0;

while (1)
{
 portc = 0;
}
}

 

If you take out the "#pragma DATA" statement, because it is not supported by the C2C Plus compiler, and compile it with C2C plus, the code works fine when loaded by the bootloader.

 

Do you have any ideas why this is?

 

Thanks,

 

Eric

Share this post


Link to post
Share on other sites

After further investigation, I found out that the problem was that BoostC did not produce a "clrf PCLATH" instruction as the first instruction, which for some reason confused my bootloader. I tried another bootloader and it worked fine. Thus, there is no bug in BoostC, my bootloader was not robust. Consider this discussion topic completed. Sorry for the confusion.

 

Eric

Share this post


Link to post
Share on other sites
After further investigation, I found out that the problem was that BoostC did not produce a "clrf PCLATH" instruction as the first instruction, which for some reason confused my bootloader.  I tried another bootloader and it worked fine.  Thus, there is no bug in BoostC, my bootloader was not robust.  Consider this discussion topic completed.  Sorry for the confusion.

Which bootloader does work? Can you post URL where to find it?

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...