Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] ST-Flash's --reset option & F4 DMA registers cleaning #382

Closed
mcoquelin-stm32 opened this issue Mar 11, 2016 · 5 comments · Fixed by #1124
Closed

[feature] ST-Flash's --reset option & F4 DMA registers cleaning #382

mcoquelin-stm32 opened this issue Mar 11, 2016 · 5 comments · Fixed by #1124

Comments

@mcoquelin-stm32
Copy link
Contributor

Hi,

I wonder whether we should always reset the devices, i.e. make the reset option a default one.
Doing this, I guess we could get rid of the DMA registers cleaning on F4?

Just let me know if you are ok on the principle, and I will propose a patch.

Thanks,
Maxime

@xor-gate
Copy link
Member

xor-gate commented Jun 2, 2016

Hi Maxime @mcoquelin-stm32,

I'm planning for v2.0.0 to rewrite/fixup the commandline argument parser. For which tool do you want to implement this? Probably we should also add a commandline switch then.

@mcoquelin-stm32
Copy link
Contributor Author

Hi Jerry,

That is a good idea:
Note that I have developed an external memory loader based in Texane (https://github.com/mcoquelin-stm32/stlink/blob/external_loader/extloader/main.c). I allow to re-use external loaders from ST's STLink Utility to read/write external NOR and NAND.
For this implementation, I have use standard's getopt to parse parameters.
Feel free to comment it on my branch if you see any improvements that could be done, and don't hesitate to pick some code from this example.

That said, I'm not sure to understand your question:

For which tool do you want to implement this?

I initially created this ticket because I didn't see any advantage not to reset the chip before programming it.
And in some cases, clearing DMA is not enough.
I have for example a case where I remap the SDRAM bank 0 in 0x0 on STM23F429, by configuring SYSCFG_MEMRMP register.
In this case, if not using --reset option, the subsequent flash programming fails.
There is so much configurations that could lead to such problems, that I think that --reset shuold be the default. Maybe having a --noreset option would make sense if any application.

What is your view?

Regards,
Maxime

@xor-gate
Copy link
Member

xor-gate commented Jun 3, 2016

I totaly agree with the reset is default on programming and scrubbing the DMA. We should go with --noreset option then for v2.0.0 (@texane what do you think?). Would you like and have time to contribute when I have reworked the argopt parsing with a different implementation?

For the external loader it would be nice to have it merged for texane/stlink but needs to be rebased to latest master. And I would better see this merged after v2.0.0 because it would have some big impact on the codebase (refactoring et al). Probably we should create a seperate feature/issue for the external loader which is related to this issue (Quad SPI NOR flash): #412

@xor-gate xor-gate added this to the Unplanned (Contributions Welcome) milestone Sep 13, 2016
@ghost
Copy link

ghost commented Mar 19, 2018

@mcoquelin-stm32 The external loader's address range is limited to 32-bit (so no F746G-discovery programming). Is this a bug?

@Nightwalker-87 Nightwalker-87 modified the milestones: Unplanned (Contributions Welcome), Next Feb 19, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: General, v1.7.0, Feedback required Mar 14, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: Feedback required, Reset issues Apr 3, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: d) Reset issues, v1.6.2 Oct 22, 2020
@Nightwalker-87 Nightwalker-87 changed the title ST-Flash's --reset option & F4 DMA registers cleaning [reset] ST-Flash's --reset option & F4 DMA registers cleaning Oct 22, 2020
@Nightwalker-87 Nightwalker-87 changed the title [reset] ST-Flash's --reset option & F4 DMA registers cleaning [feature] ST-Flash's --reset option & F4 DMA registers cleaning Mar 13, 2021
@Nightwalker-87 Nightwalker-87 modified the milestones: v1.6.2, v1.7.0 Mar 13, 2021
@Nightwalker-87
Copy link
Member

In reference to #74 & #122.

@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 13, 2021
@Nightwalker-87 Nightwalker-87 moved this to Done in Release v1.7.0 Apr 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.