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

Flashing cc2530/cc2591 with Arduino #21

Closed
rocklobster42195 opened this Issue Jul 12, 2018 · 14 comments

Comments

Projects
None yet
3 participants
@rocklobster42195
Copy link

commented Jul 12, 2018

Hi.
I tried to flash a cc2530/cc2591 with an Arduino Uno. It seems that the connection is ok:

INFO: Found a CC2530 chip on COM5

Chip information:
      Chip ID : 0xa524
   Flash size : 16 Kb
    Page size : 2 Kb
    SRAM size : 1 Kb
          USB : No

Device information:
 IEEE Address : 000000000000
           PC : 0000

Debug status:
 [ ] CHIP_ERASE_BUSY
 [ ] PCON_IDLE
 [X] CPU_HALTED
 [ ] PM_ACTIVE
 [ ] HALT_STATUS
 [X] DEBUG_LOCKED
 [X] OSCILLATOR_STABLE
 [ ] STACK_OVERFLOW

Debug config:
 [ ] SOFT_POWER_MODE
 [ ] TIMERS_OFF
 [ ] DMA_PAUSE
 [ ] TIMER_SUSPEND

But when I tried to flash the CC2530ZNP-Test_for_CC2591.hex I got the following error:
IOError: Line 1: Source file is not in HEX format! Do I need a special version for an arduino-flash?

Thanks for your help.
Boris

@kirovilya

This comment has been minimized.

Copy link
Collaborator

commented Jul 12, 2018

You need to download the firmware file in raw format https://github.com/kirovilya/files/blob/master/CC2530ZNP-Test_for_CC2591.hex

@kirovilya

This comment has been minimized.

Copy link
Collaborator

commented Jul 12, 2018

Or download zip-archive of all repo and extract one file from it

@kirovilya

This comment has been minimized.

@rocklobster42195

This comment has been minimized.

Copy link
Author

commented Jul 12, 2018

Thanks. Now I get this error:

INFO: Found a CC2530 chip on COM5

Chip information:
      Chip ID : 0xa524
   Flash size : 16 Kb
    Page size : 2 Kb
    SRAM size : 1 Kb
          USB : No
Traceback (most recent call last):
  File "cc_write_flash.py", line 48, in <module>
    hexFile.load()
  File "D:\temp\CCLib\Python\cclib\cchex.py", line 128, in load
    self._loadHex()
  File "D:\temp\CCLib\Python\cclib\cchex.py", line 367, in _loadHex
    raise IOError("Line %i: Unknown record type %02x" % (i, bType))
IOError: Line 14140: Unknown record type 05
@kirovilya

This comment has been minimized.

Copy link
Collaborator

commented Jul 12, 2018

Oh! I forgot... For Arduino you need modify firmware by removing second line from the end of file.

@rocklobster42195

This comment has been minimized.

Copy link
Author

commented Jul 12, 2018

I did that.

Chip information:
      Chip ID : 0xa524
   Flash size : 16 Kb
    Page size : 2 Kb
    SRAM size : 1 Kb
          USB : No
Sections in CC2530ZNP-Test_for_CC2591.hex:

 Addr.    Size
-------- -------------
 0x0000   6 B
 0x002b   3 B
 0x0043   3 B
 0x0053   3 B
 0x006b   3 B
 0x0083   32626 B
 0x7ff8   7 B
 0x8000   32762 B
 0x10000   32762 B
 0x18000   32739 B
 0x20000   32751 B
 0x28000   32702 B
 0x30000   29675 B

ERROR: Data too bit to fit in chip's memory!
@kirovilya

This comment has been minimized.

Copy link
Collaborator

commented Jul 12, 2018

Hmm... Strange... Sorry, I never flash cc2530/cc2591 from Arduino, only cc2530 and cc2531.
I try to find solution...

@rocklobster42195

This comment has been minimized.

Copy link
Author

commented Jul 12, 2018

Thank you very much! No need to hurry!

@kirovilya

This comment has been minimized.

Copy link
Collaborator

commented Jul 12, 2018

Try to comment lines 67, 68, 69 in cc_write_flash.py:

# if maxMem > (dbg.chipInfo['flash'] * 1024):
# 	print("ERROR: Data too bit to fit in chip's memory!")
# 	sys.exit(4)
@rocklobster42195

This comment has been minimized.

Copy link
Author

commented Jul 12, 2018

It is flashing!
Now we have to wait...

@kirovilya

This comment has been minimized.

Copy link
Collaborator

commented Jul 12, 2018

If flashing is success, before using you need connect P04, P06, P20 to GND

@rocklobster42195

This comment has been minimized.

Copy link
Author

commented Jul 13, 2018

Unfortunately I only have a bad manual for my device. The pins are only labeled P1_2, P1_4...etc.
unbenannt

Is there a common assignment?

@kirovilya

This comment has been minimized.

Copy link
Collaborator

commented Jul 13, 2018

Yes. You need connect P0_4 and P0_6 and P2_0 to GND

@rocklobster42195

This comment has been minimized.

Copy link
Author

commented Jul 13, 2018

Aaaaah. Stupid me! :-D
IT'S WORKING!
Thank you.

arteck pushed a commit that referenced this issue Apr 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.