Author Topic: To Code Composer Studio (CCS) users...  (Read 2223 times)

0 Members and 1 Guest are viewing this topic.

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
To Code Composer Studio (CCS) users...
« on: January 08, 2023, 02:36:47 am »



To MSP430 CCS users, I have some questions.

I disassembled the BSL machine code I downloaded from the chip and inserted the lines at CCS. It can't even recognize one line. Why? How is the assembly code in CCS differ to others exactly?

"
naken_util - by Michael Kohn
                Joe Davisson
    Web: http://www.mikekohn.net/
  Email: mike@mikekohn.net

Version:

Loaded hexfile outputbsl.hex from 0x0c00 to 0x0fff
Type help for a list of commands.

Addr    Opcode Instruction                              Cycles
------- ------ ----------------------------------       ------
0x0c00: 0x0c06 mova @r12, r6                            ?
0x0c02: 0x0c1e mova @r12+, r14                          ?
0x0c04: 0x3fff jmp 0x0c04  (offset: -2)                 2
0x0c06: 0x40b2 mov.w #0xa540, &0x012c                   5
0x0c08: 0xa540
0x0c0a: 0x012c
0x0c0c: 0x90b2 cmp.w #0xaa55, &0xffbe                   5
0x0c0e: 0xaa55
0x0c10: 0xffbe
0x0c12: 0x27ff jeq 0x0c12  (offset: -2)                 2
0x0c14: 0x4031 mov.w #0x0224, SP                        2
0x0c16: 0x0224
0x0c18: 0x430b mov.w #0, r11                            1
0x0c1a: 0x43c0 mov.b #0, 0x0216                         2
0x0c1c: 0xf5fa
0x0c1e: 0xc232 dint  --  bic.w #8, SR                   1
0x0c20: 0xc0f2 bic.b #0x32, &0x0000                     5
0x0c22: 0x0032
0x0c24: 0x0000
0x0c26: 0x40b2 mov.w #0x5a80, &0x0120                   5
"
taken from the FET TI-Txt output:

"
:100C0000060C1E0CFF3FB24040A52C01B29055AA25
:100C1000BEFFFF27314024020B43C043FAF532C226
:100C2000F2C032000000B240805A20010F43F2406F
:100C300088005700F24080005600E2D32100E2D342
:100C40002200E2C32600E2C22A00E2C22E00B24025
:100C500000A528013BC07A00B012860E8243120222
:100C6000094336400A023742B012540FC64C000006
:100C700016531783F9232BB32E2055420B0216422D
:100C80000E02E60F1742100275901200792475903B
:100C900010005424B012580E55420B0275901800E3
:100CA00032242BB21824759020001B247590160056
:100CB000282475901400A12475901A001E247590A4
:100CC0001C003224759021000924053C2BD2B0125F
:100CD000E60EBD3F2153B012EC0EB93F2F000E02BD
:100CE000F63FB012E60ED2420E025600D2420F027A
"

The CCS has a Disassembly screen. It means the program has within it the ability to convert machine code directly to assembly. How do you run CCS such that you are connected to the chip via JTAG and MSP-FET and you will see disassembly directly of the machine codes in the chip without inputting in the program any source code at the top screen window? How do you run it this way since it has within it the assembly conversion and can do it theoretically on paper.
« Last Edit: January 08, 2023, 02:43:47 am by planc »
 

Offline josip

  • Regular Contributor
  • *
  • Posts: 154
  • Country: hr
Re: To Code Composer Studio (CCS) users...
« Reply #1 on: January 08, 2023, 08:26:54 am »
Create empty project in assembler for your target device and than insert there assembler code that you want to test 

 

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
Re: To Code Composer Studio (CCS) users...
« Reply #2 on: January 08, 2023, 08:44:37 am »

I watched the video. But remember there was no assembly code to insert. I want the CCS to read directly the machine code from the running unlocked MSP430 and dissemble them into assembly code in the assembly screen (without any existing assembly code).

This is because Naken disassembled them into wrong assembly codes. Not even one line ran if I got the assembly code from the Naken disassemble (see my original message above).

Techanically CCS has within it the ability to read the machine code directly from unlocked chip and disassemble into assembly code output. How do you invoke this?
 

Offline josip

  • Regular Contributor
  • *
  • Posts: 154
  • Country: hr
Re: To Code Composer Studio (CCS) users...
« Reply #3 on: January 08, 2023, 10:10:01 am »
Create blank project for your target device. Uncheck "erase" and "download" option to target device. Also uncheck "reset" or "jump to main". And check "attach to running target". With all this, after start debugger should continue stepping & executing original assembler code on target device.

I am not using CCS, and never done this with IAR, so if you have further questions related to CCS ask CCS experts here...
https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum
 
The following users thanked this post: planc

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
Re: To Code Composer Studio (CCS) users...
« Reply #4 on: January 08, 2023, 11:18:05 am »

Such advances in the CCS. I couldn't ask at the TI forums because only companies were allowed to participate there, not ordinary public. Anyway last questions before I connect the MSP-FET430UIF to the chip in real time debug mode. The Ti Txt or Intel Hex that you downloaded to a file in the MSP Flasher is the same file that you need to write in case the chip main and info memory got erased, right? 100% same format?

I'm trying to understand how the firmware in a very expensive laboratory equipment work at a basic level. If I ruin the chip, I couldn't use the equipment again.
 

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
Re: To Code Composer Studio (CCS) users...
« Reply #5 on: January 08, 2023, 01:30:05 pm »



After one hour searching at CCS 12, I couldn't find josip option to Uncheck "Erase" (there is none in above screenshot and other pages), and I couldn't ask at TI forum because only company accounts are allowed there.

For those using CCS. Where exactly can I find the option Uncheck "Erase" and Uncheck "Download", Uncheck "Reset", etc. as in josip instructions "Create blank project for your target device. Uncheck "erase" and "download" option to target device. Also uncheck "reset" or "jump to main". And check "attach to running target". With all this, after start debugger should continue stepping & executing original assembler code on target device." ??

Please where how exactly to find them.. Thanks.
 

Offline josip

  • Regular Contributor
  • *
  • Posts: 154
  • Country: hr
Re: To Code Composer Studio (CCS) users...
« Reply #6 on: January 08, 2023, 03:31:26 pm »

Such advances in the CCS. I couldn't ask at the TI forums because only companies were allowed to participate there, not ordinary public. Anyway last questions before I connect the MSP-FET430UIF to the chip in real time debug mode. The Ti Txt or Intel Hex that you downloaded to a file in the MSP Flasher is the same file that you need to write in case the chip main and info memory got erased, right? 100% same format?

I'm trying to understand how the firmware in a very expensive laboratory equipment work at a basic level. If I ruin the chip, I couldn't use the equipment again.

Firmware dumped with MSP-Flasher can be written back to device in the same format as it is exported. During dumping you can also verify it dumped file against device contest...

msp430flasher -r[info.txt,INFO] -v info.txt -z[VCC]
msp430flasher -r[main.txt,MAIN] -v main.txt -z[VCC]

You can follow your question about CCS on TI e2e here...
https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1185310/msp430f2617-attaching-to-running-target-in-ccs-without-source-code
 

Offline josip

  • Regular Contributor
  • *
  • Posts: 154
  • Country: hr
Re: To Code Composer Studio (CCS) users...
« Reply #7 on: January 08, 2023, 05:15:53 pm »
I just tried this with IAR on MSP430F5529 LP and it is working just fine. I downloaded blink example binary outside IAR, generated blank project for MSP430F5529 target inside IAR, build it and used restarting debugger without downloading code. After this I was able to step instruction by instruction in assembler of blink binary example. Screenshot is attached.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4219
  • Country: us
Re: To Code Composer Studio (CCS) users...
« Reply #8 on: January 08, 2023, 05:26:10 pm »
The original post error is "No input files."
So you apparently haven't added the "main.asm" file you created to the project.  And maybe it should be called main.S

 

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
Re: To Code Composer Studio (CCS) users...
« Reply #9 on: January 09, 2023, 09:50:29 am »
(wait few secs for a few images to load)

josip, you mentioned this line "msp430flasher -r[main.txt,MAIN] -v main.txt -z[VCC]"

when I searched for Z[VCC] in the msp flasher manual, this shows up:



Something confused me. The following shows the Elprotronic FET-Pro430 connecting to the 2617 chip in my expensive laboratory equipment.





When I checked the manual on the voltage part. I read this:



Questions.

1. Your msp flasher Z[VCC] manual says it's 3.0 volts. But why does the FET-Pro430 showing 3.22V on right side of RESET? It's not mentioned it the manual shown above what the 3.22V stands for. And should I adjust the Power Device from Adapter to 3 volts or 3.3 volts?

2. Does MSP-FET430UIF have the ability like the TI-USB-FET to program the output DC level? output of what? The Vcc of the target?  Note in the following PINOUT.



3. I powered on the entire laboratory equipment (with the MSP430 chip inside I'm JTAGing) and connect the laboratory equipment VCC  to VCC_TARGET of the FET above (as well as the 4 standard JTAG pins). This is to set the FET pin level using the VCC of the target (as the instruction below says). The reason I didn't connect the VCC_Tool (or use the FET as VCC) source is there is no diagram to connect both the ground of the FET and device together. How do you do that? Also if I use the VCC of the FET as source, it may power not just the chip but all the ICs in the laboratory equipment. Right?? This may overload the FET.

« Last Edit: January 09, 2023, 09:54:45 am by planc »
 

Offline josip

  • Regular Contributor
  • *
  • Posts: 154
  • Country: hr
Re: To Code Composer Studio (CCS) users...
« Reply #10 on: January 09, 2023, 10:39:30 am »
I am using " Z[VCC]" just to leave free running target device after MSP Flasher operation, not for any voltage setup. I never used Elprotronic GUI. Self powered target device voltage should be connected to pin 4 VCC TARGET that is reference for master voltage logic translators. pin 2 VCC TOOL should be left unconnected.
« Last Edit: January 09, 2023, 10:42:26 am by josip »
 

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
Re: To Code Composer Studio (CCS) users...
« Reply #11 on: January 09, 2023, 11:44:47 am »

But if you won't power (or "self power") your target device and use the power from the FET and connect to PIN 2 VCC TOOL (with pin 4 VCC TARGET unconnected). How do you connect the ground of the target device which is not powered?

The target is also powered from USB only (when it is running alone fully functioning), just like the FET also connected to USB. So I think the FET can power the target, but how do you connect the target chip ground? To the FET or ground left hanging? Will the chip run without ground connected to the FET or USB?
 

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
Re: To Code Composer Studio (CCS) users...
« Reply #12 on: January 09, 2023, 12:39:16 pm »

Here is the 2nd scenerio where the target is self-powered and connecting to VCC_Target (with VCC_Tool not connected). Should you connect the grounds of both FET and Target together. In the following picture of the FET and wires, I did connect the grounds of both FET and target together in one wire.



What would happen when you connect the grounds of 2 separate powered device?

In first case (in my last message). You can connect both grounds of FET and Target if Target is powered by the FET Vcc_Tool?

What are the ground rule of the actual?
 

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
Re: To Code Composer Studio (CCS) users...
« Reply #13 on: January 11, 2023, 01:27:48 am »

When the target is self powered and connected to the pin 4 VCC_Target (with pin2 VCC_Tool disconnected). And I didn't connect the ground of both. It won't run so I guess the FET is sensing the ground from the target device VCC?

Anyway for the following chinese MSP-FET430UIF clones that you can find so many at Ebay.  Since the FET are open source. Is it considered open source or pirated hardware? I was asking this the past months and still don't know the answer. And need to know since planning to get one to see what the chip is made of.



Pinout of the original with missing VCC_Target in the clone above (is it expensive to make the Vcc_Target hardware?):


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf