0

Hey is there anybody who works with SDCC to make projects for 8051 microcontroller series on Macbook. If yes then can you please post the working make file, specially the part which loads the program in the device. I am confused what to write specifically with the program tag in the Makefile.

Mayukh Sarkar
  • 2,289
  • 1
  • 14
  • 38
  • The use of [sdcc](http://sdcc.sourceforge.net/) and even 8051 is largely irrelevant; what you probably need to specify is the device programmer and the software you are using to program the device - neither are part of sdcc AFIK. Even the use of make is irrelevant; you should start by programming the device using the utility directly from the command line - when you can do that, that's the command you need to add to make. – Clifford Apr 27 '15 at 18:19

1 Answers1

0

It is not necessarily the case that a makefile include loading the code to the part, so just any old example will not help. Makefiles are very simple in essence; you have a target, and its dependencies - if the target does not exist, or any dependency is newer than the target, the target is rebuilt by executing the commands.

In your case you need a phony target (one that never exists), that is dependent on the binary image or hex-file (or whatever format you load file is), the the command to execute would be to launch whatever flash-programming or bootloader tool your toolchain uses to load the image:

.PHONY loadimage
loadimage : myprogram.hex
    loader.exe myprogram.hex
Clifford
  • 88,407
  • 13
  • 85
  • 165
  • I am sorry but I think you don't understand my problem..I am asking for how to select the the port address for Mac, and what will be the fuse bit configurations for it..The one that you showed is the macro level explanation..I am asking for the exact configuration with the loader.exe. – Mayukh Sarkar Apr 27 '15 at 13:01
  • @MayukhSarkar : Then perhaps you might consider that your question may not be very clear and you should edit it to avoid confusion. I cannot see how the use of a Macbook would have any bearing on fuse bit configuration, and you never mentioned fuse bits in the question. Moreover AFAIK fuse bits are not generically common to all 8051 core devices, so you would probably need to specify the actual part in any case, but even then surely that is a matter for you reading the data sheet, not SO? Finally without knowing what programming hardware you are using, who could have a clue? – Clifford Apr 27 '15 at 18:05
  • @MayukhSarkar : I think it is still entirely unclear what you are asking; your previous comment appears to be an entirely different question to the one you asked. However to determine what port name a particular hardware device is enumerated as on OSX you should install [hardware Growler](https://itunes.apple.com/us/app/hardwaregrowler/id475260933?mt=12&ign-mpt=uo%3D4). It will display the device name assigned to any hardware when you connect it. The port name will be specific to your system and dependent on what other devices of the same device class are connected. – Clifford Apr 27 '15 at 18:12