Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use EBlink with ST-LINK2 on Atmel SAM3X8E CPU
#1
Hello

I tri to use EBLink with an ST-Link2 connected to an old Arduino Due (Atmel SAM3X8E)

When starting EBlink it seems to detect a Cortex M3, which is correct. But then there is an error:

"Can't detect MCU vendor"

There is also a message to eventually disable the "dr" option, but this has no effect (I started both the stm32gdg and stm32hotplug versions)

How can I get the ST-Link to accept non ST hardware?
Reply
#2
Hi,

This is because there are no script files for this MCU type yet. Only SAM[D,C,L] are currently available in the scripts.
I don't have any boards with these MCU's so I can't add the scripts right now.

BTW
A new EmBitz version is coming with bug fixes special for Atmel users.
There was a bug in the SVD viewer for group registers (like SERCOM SPI,USART etc) and EBlink is updated to version 4.7. with special DSU reset strategies.
Reply
#3
(29-10-2022, 07:49 AM)embitz Wrote: Hi,

This is because there are no script files for this MCU type yet. Only SAM[D,C,L] are currently available in the scripts.
I don't have any boards with these MCU's so I can't add the scripts right now.

BTW
A new EmBitz version is coming  with bug fixes special for Atmel users.
There was a bug in the SVD viewer for group registers (like SERCOM SPI,USART etc) and EBlink is updated to version 4.7. with special DSU reset strategies.

Hi,

I have taken a look into the scripts. The current implementation just checks target.cpuType to be zero (Cortex-M0), otherwise the script stops with an MCU unknown error. 
Probably I have to further check the cpuType (I'm testing with an Arduino Due SAM3X8e, which has cpuType 3 = Cortex M3) It seems, my MCU does not have a DSU unit, instead the identification data comes from a unit called CHIPID. Register CHIPID_CIDR contains information on architecture, Ram and flash sizes etc. You have already put a comment to access idenitifaction with command intrfApi.readMem32(0x400E0940).

I have also checked the SAME70 family specification, these MCUs use the same CHIPID definition like the SAM3X. Maybe there could be a strategy to check this register for all cpuTypes other than Cortex-M0. What do you think?

As far as I understand, I will have to extend the "atmel-auto.script" to call new specialised scripts for each new MCU family. For the existing implementation, there is only "samcd.script", so I have to implement individual script variants like "sam_e.script" etc. I have also seen, that the SAMD uses special reset handling. I do not yet understand what this code does. Can you tell, if this has to be implemented for the non DSU devices too?

Best regards
   Michael
Reply
#4
Perhaps it is easier to make a single device script first. You don't have to worry about memory detection etc

E.g. call you script sam3.script and start EBlink as:

Eblink -S sam3 -G (for gdb).

- The script must contain a 'main' function.
- The script must provide EB with a valid xml memory map
- The post reset function setting pc and sp (or do it in the GDB settings of the IDE)

The most tricky part are Flash routines. The chip erase function can be skipped for later. If it is not there EB will use sector by sector erase instead of chip erase.

Generic flashing procedure:

- unlock flash
- sector erase function either by address or sector number.
- sector write function.
- locking the flash.



I will receive a board in a couple of days so I can help you if necessary.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)