GQ Electronics Technical Support Forum


GQ Electronics Technical Support Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 GQ Electronics Forums
 2.GQ Geiger Muller Counter
 GMC500+, How do Flash erase from USB remote ctrl
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Damien68

France
58 Posts

Posted - 08/24/2019 :  00:22:03  Show Profile  Reply with Quote
Hi,
I build my own application to downlod data from my GMC-500+.
This working fine even with 16/24/32bits data format, i tested it with a function generator conected on the tube cathode.
This working because i assume recording rate is 1 per minutes (CPM), this is what i need what i want.

But to complete my app i want to do auto-archive function to download and store data on PC hard drive.
To do this I need to erase flash after downloding his content.
How to do this?
What is the commande?

My app run on .NET windows framwork and compiled with free Visual studio community.

Bellow an overview of app, i can pan, zoom, translate curve with mouse wheel and shift CTRL keybord key or by mouse click and move.
I have also to add many statistic information (max avg min variance)

Certainly I would try to post the source code on GitHub when done.

Thanks in advence.



Image Insert:

74825 bytes

Mastery is acquired by studying, with it everything becomes simple

Edited by - Damien68 on 08/30/2019 05:33:35
Reply #1

EmfDev

908 Posts

Posted - 08/26/2019 :  09:36:21  Show Profile  Reply with Quote
Hi Damien, you can try to do this sequence but might now work.

-> Get the configuration file saved
-> Erase SPI chip
-> Write the configuration 1 by 1.
-> update cfg
Go to Top of Page
Reply #2

Damien68

France
58 Posts

Posted - 08/26/2019 :  23:43:40  Show Profile  Reply with Quote
Hi EmfDev,
I do not know how to erase completely the SPI Flash memory. Should I use one of the following commands?(FACTORYRESET or ECFG)?
==============================================================================
20. Reset unit to factory default
command: <FACTORYRESET>>
Return: 0xAA
==============================================================================
8. Erase all configuration data
Command: <ECFG>>
Return: 0xAA

I just have (USB) Serial command set named Communication Protocol - GQ-RFC1801

Mastery is acquired by studying, with it everything becomes simple

Edited by - Damien68 on 08/27/2019 01:28:10
Go to Top of Page
Reply #3

EmfDev

908 Posts

Posted - 08/27/2019 :  09:33:41  Show Profile  Reply with Quote
There is the <SPISE[][][]>> command to erase sector of the SPI. SPI is 1MB and 1 sector is 4k each.
And yes you can also use factory reset to erase the spi chip. But make sure to getthe CFG first then right it back after factory reset.
Go to Top of Page
Reply #4

Damien68

France
58 Posts

Posted - 08/27/2019 :  10:55:26  Show Profile  Reply with Quote
Hi EmfDev,
Thank you for this complete information, I think it will allow me to finish my project.
There is one point that I would like to clarify,
I opened my GMC-500 +, the external flash placed is a Winbond W25Q16JV which is therefore 16Mbits or 2MBytes.
To avoid any confusion, we use only the first half of the memory?

Mastery is acquired by studying, with it everything becomes simple

Edited by - Damien68 on 08/27/2019 10:59:51
Go to Top of Page
Reply #5

EmfDev

908 Posts

Posted - 08/27/2019 :  11:26:12  Show Profile  Reply with Quote
That's correct.
Go to Top of Page
Reply #6

Damien68

France
58 Posts

Posted - 08/29/2019 :  03:55:04  Show Profile  Reply with Quote
Hi EmfDev,
I can erase the Flash, it works well.
However, I have the following problem:
After erasing the Flash, the GMC-500 + continues to save its data to the old Flash current location address.
is there any way to control this pointer to reset it at the beginning of the memory after erasing the entire Flash?


Image Insert:

847684 bytes

Mastery is acquired by studying, with it everything becomes simple
Go to Top of Page
Reply #7

EmfDev

908 Posts

Posted - 08/29/2019 :  09:01:05  Show Profile  Reply with Quote
You didn't use factory reset? Can you try this command. <SetSPISA[XX][XX][XX]>>
where [XX] == address so all should be 0x00 (0).

You can also check the address by <GetSPISA>> to check how much of SPI is occupied.

Edited by - EmfDev on 08/29/2019 09:02:16
Go to Top of Page
Reply #8

Damien68

France
58 Posts

Posted - 08/29/2019 :  12:01:55  Show Profile  Reply with Quote
to have the most neutral operation possible, and least visible by user, I prefer to use the erase commands rather than the factory reset command.
now the operation is perfect, the <SetSPISA[XX][XX][XX]>> command does not return 0xAA but works well

To reset the flash after downloading it, I use the following sequence:
1. Erasing last 4096Byte bloc of the 1MB Flash
2. Move Flash pointer to the start of this erased Bloc with <SetSPISA[XX][XX][XX]>> command
3. Erase first bloc of Flash
4. Move Flash pointer to 0x000000
5. Send <CFGUPDATE >> command to force Timestamp and control Bloc writing on the Top of the Flash
6. Erase all other needed Flash Bloc including the last one used temporary

with this procedure, it's perfect, I have no more residues in the flash only have 0xFF

Thanks for your support EmfDev

Mastery is acquired by studying, with it everything becomes simple

Edited by - Damien68 on 08/30/2019 01:43:38
Go to Top of Page
Reply #9

EmfDev

908 Posts

Posted - 08/30/2019 :  08:51:53  Show Profile  Reply with Quote
You can just move the the pointer to the start. It will automatically erase the block if it's occupied. But won't erase later blocks yet. Anyway it's good that you figured it out!
Go to Top of Page
Reply #10

Damien68

France
58 Posts

Posted - 09/04/2019 :  12:13:38  Show Profile  Reply with Quote
it effectively works very well by simply doing as you say

Mastery is acquired by studying, with it everything becomes simple
Go to Top of Page
Reply #11

Damien68

France
58 Posts

Posted - 09/06/2019 :  13:00:15  Show Profile  Reply with Quote
I just see you use CH340 device for USB to serial bridge,
I'm senior hardware architect , Geiger is just a hobbit to me, I do not have any thoughts, I'm specialised on RF devices.
It would be better to connect the USB directly to the ST microcontroller, there is just to implement the USB CDC class (communications device class) from the Framework and manage 2 or 3 things.
I do it on Atmel device but not on ST but apparently the class is made.
You save a chip and have up to 480Mbit/s bandwith because there is no more physical port, useful to download the 1MB Flash. :-)
The device is then automatically recognized like a 'Com port' by windows10, Android and certainly linux (I didn't test it on Linux) certainly IOS too ...

it's just something I wanted to share.

Mastery is acquired by studying, with it everything becomes simple

Edited by - Damien68 on 09/06/2019 13:08:58
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
GQ Electronics Technical Support Forum © Copyright since 2011 Go To Top Of Page
Generated in 0.22 sec. Snitz Forums 2000