[Psoc6] Problem with creating bin file in Keil

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
psoc_student
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

Hello, I have a question about the problem that occurred while creating the file 'bin' in 'Keil'.

 

; Cortex-M4 application flash area
LR_IROM1 FLASH_START FLASH_SIZE
{
    ER_FLASH_VECTORS +0
    {
        * (RESET, +FIRST)
    }

    ER_FLASH_CODE +0 FIXED
    {
        * (InRoot$$Sections)
        * (+RO)
    }

    ER_RAM_VECTORS RAM_START UNINIT
    {
        * (RESET_RAM, +FIRST)
    }

    RW_RAM_DATA +0
    {
        * (.cy_ramfunc)
        * (+RW, +ZI)
    }

    ; Place variables in the section that should not be initialized during the
    ; device startup.
    RW_IRAM1 +0 UNINIT
    {
        * (.noinit)
    }

    ; Application heap area (HEAP)
    ARM_LIB_HEAP  +0 EMPTY ((RAM_START+RAM_SIZE)-AlignExpr(ImageLimit(RW_IRAM1), 8)-STACK_SIZE)
    { 
    }

    ; Stack region growing down
    ARM_LIB_STACK (RAM_START+RAM_SIZE) EMPTY -STACK_SIZE
    {
    }

    ; Used for the digital signature of the secure application and the
    ; Bootloader SDK application. The size of the section depends on the required
    ; data size.
    .cy_app_signature (FLASH_START + FLASH_SIZE - 256) 256
    {
        * (.cy_app_signature)
    }
}

; Emulated EEPROM Flash area
LR_EM_EEPROM EM_EEPROM_START EM_EEPROM_SIZE
{
    .cy_em_eeprom +0
    {
        * (.cy_em_eeprom)
    }
}

 

Above is the contents of the 'sct' file in the ToolChain_ARM folder.

If you proceed with the build in the current situation, it will be displayed as a folder, not a file, as shown below.

psoc_student_1-1652769822530.pngpsoc_student_0-1652769414891.png

If i use 'hex2bin' to switch to 'bin', the function "EM_EEPROM" will not be available.

If you look at the 'sct' code above, it seems to be caused by the load area being divided into LR_EM_EEPROM and LR_IROM1.

I want to know how to combine the areas of "LR_EM_EEPROM" and "LR_IROM1" to build.

 

0 Likes
1 Solution
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @psoc_student ,

Can you please try using the srec_cat.exe software mentioned in the below link for conversion to bin format:
https://developer.arm.com/documentation/ka003932/latest

 

Few points to consider when using this in Keil:

1. Add the path of the folder containing the srec_cat.exe to your system environment variables.

2. Make sure it is reflected by running the 'srec_cat.exe --version' command in a command terminal as shown below:

AlenAn14_2-1652791330200.png

 

3. If Keil uVision is open, please close and reopen the same

4. Add the following command to target options>>user>>Run #1 in Keil:

srec_cat.exe "<Path to project>\Hello_World_Keil\Hello_World_Keil_Objects\Hello_World_Keil.hex" -Intel -o "<Path to project>\Hello_World_Keil\Hello_World_Keil_Objects\BinaryFile.bin" -Binary

Note : Double Quotes are necessary 

The above command is to be added to the 'Run#1' as shown below:

AlenAn14_0-1652791098860.png

Also note to check for Hex file in the 'Output tab' as below:

AlenAn14_1-1652791150281.png

 

Warm Regards
Alen

 

 

View solution in original post

0 Likes
4 Replies
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @psoc_student ,

Can you please try using the srec_cat.exe software mentioned in the below link for conversion to bin format:
https://developer.arm.com/documentation/ka003932/latest

 

Few points to consider when using this in Keil:

1. Add the path of the folder containing the srec_cat.exe to your system environment variables.

2. Make sure it is reflected by running the 'srec_cat.exe --version' command in a command terminal as shown below:

AlenAn14_2-1652791330200.png

 

3. If Keil uVision is open, please close and reopen the same

4. Add the following command to target options>>user>>Run #1 in Keil:

srec_cat.exe "<Path to project>\Hello_World_Keil\Hello_World_Keil_Objects\Hello_World_Keil.hex" -Intel -o "<Path to project>\Hello_World_Keil\Hello_World_Keil_Objects\BinaryFile.bin" -Binary

Note : Double Quotes are necessary 

The above command is to be added to the 'Run#1' as shown below:

AlenAn14_0-1652791098860.png

Also note to check for Hex file in the 'Output tab' as below:

AlenAn14_1-1652791150281.png

 

Warm Regards
Alen

 

 

0 Likes

Hello, @AlenAn14 

I tried using it in a simple way.

First, I wrote the following information on 'Notepad'.

[srec_cat.exe jump_test.hex -Intel -o jump_test.bin -Binary]

Second, I changed 'txt' file to 'bat' file.

psoc_student_1-1652832458635.png

 

Finally, the 'bat' file was executed to obtain the 'bin' file.

As a result, I was able to get the file 'bin', but I found a problem.

The problem is, the size of the file is too large.

psoc_student_2-1652832595228.png

Is there a problem with my way?

 

Thank you for your reply.

 

 

 

0 Likes

Hi @psoc_student ,

I too observe the same on my side as well and the same is expected. Please have a loot at the below thread from ARM for more information as to why this happens:
https://community.arm.com/support-forums/f/keil-forum/33857/bin-size-is-larger-than-hex-file#:~:text....

Warm Regards
Alen

0 Likes
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @psoc_student ,

Glad your query is resolved!
Please feel free to post any queries or issues you may have on Infineon products in the community and we will be happy to help.

Thanks and Regards,
Alen
Cypress Semiconductor Corporation
An Infineon Technologies Company

0 Likes