Currently working with STM32F427 which uses Cortex-M4, so migrating legacy code from GHS MULTI IDE to KEIL MDK-ARM. In some part legacy code GHS Multi IDE defines data segment is assigned to some variables for calculating the address width. Is it possible to define text and data segment to code in KEIL.
Hello
I assume you mean Data segment is where your variables are and text segment is where the assembly instructions are stored.
Keil MDK uses a Scatter File to determine this. MDK will create a scatter file for you (filename.sct) or you can create and add your own.
I am not a scatter file expert - but will try and give you some hints.
Selecting Options for Target (Magic Wand icon or Alt-F7) and select the Target tab as shown below:
The left side is the memory (Flash or RAM) where your program will be stored and the right is for variables etc. This example is for the STM32F407 processor.
Create your program and variables and so on - and the Linker will allocate these in memory accordingly.
You can click on the Linker tab to see where the scatter file can be selected.
You can look in the Linker manual for more detail information: Linker User Guide: Scatter-loading Features
Hope this helps....
Bob