Hi again,

I got a chance to test this and found that you should use

volatile __data BDT_t * ep0Bo_p = (volatile __data BDT_t *)0x2000;
volatile __data setup_package_t * setupPackage_p = (volatile __data
setup_package_t *)0x2070;

The first __data makes the code more efficient (__data pointer vs. generic
pointer), the second __data per line avoids warnings an casting literals to
generic pointers.

Have fun,
Raphael


2015-02-13 7:22 GMT+01:00 Raphael Neider <rnei...@web.de>:

> Hi,
>
> the datasheet states that:
>
> <quote>
> 3.3.2.1 Linear Access to GPR
> The general purpose RAM can be accessed in a non-banked method via the
> FSRs.
> </quote>
>
> It is thus illegal to use banked access to address in the linear range
> (0x2000+). SDCC does not know this.
> The workaround is to use pointers to address the linear range, like:
>
> volatile BDT_t * ep0Bo_p = (volatile BDT_t *)0x2000;
> volatile setup_package_t * setupPackage_p = (volatile setup_package_t
> *)0x2070;
>
> ...
> ep0Bo_p->ADDR = AddrToPhysical(setupPacket);
> ...
>
> I can currently not test this, will do so as soon as possible (=> weekend).
>
> Hope that helps,
> Raphael
>
>
> 2015-02-11 14:23 GMT+01:00 Richard Hughes <hughsi...@gmail.com>:
>
>> On 10 February 2015 at 20:59, Richard Hughes <hughsi...@gmail.com> wrote:
>> > ... and then doing "ep0Bo.ADDR = (uint16_t) &setupPacket;"
>>
>> It seems that referencing ep0Bo doesn't actually do the BANKSEL --
>> looking at the .lst file with --debug-xtra I see this:
>>
>> 0000c6   0060     nop                          BANKSEL    _ep0Bo
>> ;id=322,key=006,inCond:0,outCond:0,flow seq=004
>>
>> So rather than doing something normal like "MOVLB 15" it's actually
>> doing nothing. In 16f1454_g.lkr it has:
>>
>> LINEARMEM  NAME=linear0    START=0x2000            END=0x23EF
>>  PROTECTED
>> SECTION    NAME=LINEAR0    RAM=linear0         // Linear Memory
>>
>> I've attached a tarball of all the fixme files.
>>
>> Richard.
>>
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming. The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, is
>> your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>> look and join the conversation now. http://goparallel.sourceforge.net/
>> _______________________________________________
>> Sdcc-user mailing list
>> Sdcc-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>>
>>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to