[chbot] Any ARM savvy people?

Charles Manning cdhmanning at gmail.com
Tue Oct 11 20:01:45 BST 2016


Hi Robin

I've done lots of work with ARM (probably coming up 20 years now). I've
never seem something like that. Nor does it raise any aha! flags. ARM is
generally a very well behaved 32 bit architecture.

arm gcc is also generally a very good compiler with very few issues. All
the phone sw in an iphone or android is built with it.

If you're still stuck, feel free to send more specific questions my way.

First things first... In general packing is not a good idea for two reasons:

1) Less people do packing therefore more likely to expose "interesting"
behaviour.
2) Packing very seldom saves space.

But that's probably not your problem...

Start off by building with the following flags
-Wall  all warnings
-Wextra even more warnings
-Werror   make all warnings into errors
-O0     No optimisation for now.

In general those will pull up any programmer daftness. Saved my bacon many
times :-).

-- Charles



On Tue, Oct 11, 2016 at 10:40 PM, Mark Atherton <markaren1 at xtra.co.nz>
wrote:

> random thoughts:
>
> have seen these kinds of things with structs before
>
> have you packed u8's & u16's into 32 bit lumps, or are the elements a mix
> of types, jamb-packed together ?
>
> don't suppose that your FLASH uses 256 byte sectors ? :)
>
> can you post the struct, also, what type of FLASH ?
>
> -Mark
>
>
> On 11/10/2016 9:58 PM, Robin Gilks wrote:
>
>> I've hit a problem with the arm-none-eabi-gcc compiler that just doesn't
>> make sense.
>>
>> I'm developing some code on an STM32F303xC system and use a struct to hold
>> config data that gets copied to/from an external flash NOR chip. It's all
>> worked great until I added a few more members and the size of the struct
>> went over 256 bytes.
>>
>> An arbitrary function (which doesn't directly use the struct) is truncated
>> and a b.n infinite loop instruction inserted in (what should be) the
>> middle. Reduce the size of the struct and is all OK again.
>>
>> I've tried playing with pack attributes but if the total size is over 256
>> bytes then boom!
>>
>> I'm getting the same with the standard Debian Jessie install:
>> gcc version 4.8.4 20141219 (release) (4.8.4-1+11-1)
>> and the AC6 version used by STM32 WorkBench Eclipse plugin
>> gcc version 5.2.1 20151202 (release) [ARM/embedded-5-branch revision
>> 231848] (GNU Tools for ARM Embedded Processors)
>>
>> Got 10k of RAM space and over 200k of flash code space left - I just don't
>> understand!!
>>
>>
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Meetings usually 3rd Monday each month. See http://kiwibots.org for
> venue, directions and dates.
> When replying, please edit your Subject line to reflect new subjects.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20161012/560636ea/attachment.html>


More information about the Chchrobotics mailing list