Wow, what a funny bit of twisty little passages. Who knew there wasn't a
"standard" way to do a software reset on an ARM chip? That seems like such
a glaring error.

So Donald, the definition of SCB_AIRCR ends up being '(*(volatile uint32_t
*)(0xE000ED0C)' after including MMIO32 as a #define.

Writing the 0x5fa << 16 | sysresetreq to it does not reset the chip. It
just proceeds to the next instruction. One of the other tidbits here might
be that I'm inside an interrupt service routine. The idea is that if you
type ^C to the console, inside of the ISR that gets the character it
notices and wants to reset the system. Calling reset_handler() works for
returning through the startup code but the interrupts are then in a weird
state. (you don't get them any more). My latest trick was to try to get the
independent watchdog to reset me, (basically kick it off and wait) but for
some unknown reason that isn't doing what I expect either. Sitting and
waiting for it to kick in, leaves me sitting around forever.  A very
perplexing problem.

--Chuck



On Sat, Jan 25, 2014 at 9:43 PM, Michael Smith <[email protected]> wrote:

>
> It’s been a while, but SYSRESETREQ not working right (in other code) on
> STM32 sounds awfully familiar.
>
> On 25 Jan 2014, at 9:41 pm, Chuck McManis <[email protected]> wrote:
>
> What got me here was that the vendor (ST Micro in this case) supplies code
> doesn't seem to work, I expect that Donald is on to something and I'm
> tracking down the definition of the address at this time.
> --Chuck
>
>
>
> On Sat, Jan 25, 2014 at 9:39 PM, Michael Smith <[email protected]> wrote:
>
>>
>> On 25 Jan 2014, at 5:05 pm, Chuck McManis <[email protected]>
>> wrote:
>>
>> So I was playing around with an example I was writing and wanted to
>> initiate a software reset, basically duplicated what pushing the reset
>> button does.
>>
>> In various docs this is called a "Software System Reset" and there is a
>> function in the cm3 sub section of loc3 that does something kinda like the
>> ARM documents called : scb_reset_system()
>>
>> That is defined as :
>>
>> void scb_reset_system(void)
>> {
>>     SCB_AIRCR = SCB_AIRCR_VECTKEY | SCB_AIRCR_SYSRESETREQ;
>>
>>     while (1);
>> }
>>
>> And presumably one calls this from your source and "poof!" you have reset
>> the system. Except it doesn't, it hangs there in the while(1); which seems
>> a bit odd.
>>
>>
>> SYSRESETREQ is just a wire out of the core:
>>
>>    -
>>
>>    The control bit SYSRESETREQ requests a reset by an external system
>>    resource. The system components that are reset by this request are 
>> IMPLEMENTATION
>>    DEFINED. SYSRESETREQ is required to cause a Local reset.
>>
>>  And the bit is nominally owned by the debugger, not code.
>>
>> IOW, what it will do for you will vary pretty widely from SoC to SoC. If
>> possible, prefer using a watchdog or a vendor-specific mechanism to reset
>> if you can...
>>
>
>
>
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
libopencm3-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel

Reply via email to