Author Topic: One Dollar One Minute ARM Development  (Read 135566 times)

0 Members and 1 Guest are viewing this topic.

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: One Dollar One Minute ARM Development
« Reply #25 on: September 03, 2014, 02:26:21 pm »
I had started to cost an $1 ARM here in UK  considering european VAT and exchange rates , shipping  it looked a bit more...  ARM chip is $7 in UK.
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline paulieTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #26 on: September 03, 2014, 03:17:40 pm »
My 10 chips come in letter envelope and PCBs in small chinese "e-pak" envelope. Do they really hit you guys up for import tax on such small items?

I shudder to think what happens with one of those "blue" boards or a Discovery.
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: One Dollar One Minute ARM Development
« Reply #27 on: September 03, 2014, 03:37:10 pm »
The 20% vat  + post man adds something , sometimes the Chinese sender will put 'gift' on the packet  and it slips through  $14  would be probably end up as  20 GBP . 
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26752
  • Country: nl
    • NCT Developments
Re: One Dollar One Minute ARM Development
« Reply #28 on: September 03, 2014, 03:45:37 pm »
Actually Wes is right. That people introduce themselves to ARM using gnu assembler and no include files is exactly what I'm really seriously proposing. Include files are not required to create a simple program.

My goal here is to show people, even those with no experience whatsoever, how to make a program. Not create a race of
I would recommend to start in C at least. But you are right: you don't need a heap load of other stuff. A C file (maybe with some macro's to access registers) and a linker description file is all you need to get a project compiled for ARM. IMHO a lot of IDEs obfustigate or hide what the compiler is actually doing.

@22swg: usually there is an minimum amount before they start charging tax. Over here it is €35. But many Chinese just stamp 'gift' on a package.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: One Dollar One Minute ARM Development
« Reply #29 on: September 03, 2014, 04:02:56 pm »
@22swg: usually there is an minimum amount before they start charging tax. Over here it is €35. But many Chinese just stamp 'gift' on a package.
You sure about that €35? I thought it was tax free up to €22, as per this page: http://bit.ly/1jaJfNZ
 

Offline janekm

  • Supporter
  • ****
  • Posts: 515
  • Country: gb
Re: One Dollar One Minute ARM Development
« Reply #30 on: September 03, 2014, 04:13:00 pm »
The 20% vat  + post man adds something , sometimes the Chinese sender will put 'gift' on the packet  and it slips through  $14  would be probably end up as  20 GBP .

No VAT or Duty when importing into the UK and the value is < £15: http://www.hmrc.gov.uk/customs/post/buying.htm (note that technically postage has to be included in that).

So long as final delivery is by Royal Mail and the declared value is < £15 (or thereabouts), it's extremely unlikely to get any charges added (our Hackerspace gets literally dozens of envelopes from China a week and never been charged to my knowledge).
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #31 on: September 03, 2014, 04:35:26 pm »
Quote
He's trying to upload the software and just notes this particular file of the entire package is too big.
I assumed that arm-...-as would be smaller than arm-...-gcc (which it turns out is not true, apparently.  Which is weird.)
The .h files are typically no tiny marvels of modularity, either.  Typical vendor strategy is to dump out a single .h file defining everything on a chip, for each separate chip part number.  The TI tm4c123gh6pm.h file for the Tiva Launchpad is about 700k.  (It should compress a lot, though.)  (Hmm.  stm32f10x.h is "only" 620kb.)
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #32 on: September 03, 2014, 05:00:29 pm »
Hmm.  That's interesting.  CMSIS apparently defines a standard format for include files that define a chip's peripherals, even though the internals of such peripherals are outside the scope of CMSIS.  "Though shalt have structure definitions cast to constant addresses", more or less.  Like:
Code: [Select]
typedef struct
{
  __IO uint16_t SR;
  uint16_t  RESERVED0;
  __IO uint16_t DR;
  : // etc
} USART_TypeDef;

//     :

#define USART2_BASE           (APB1PERIPH_BASE + 0x4400)
#define USART3_BASE           (APB1PERIPH_BASE + 0x4800)

//    :

#define USART2              ((USART_TypeDef *) USART2_BASE)
#define USART3              ((USART_TypeDef *) USART3_BASE)
That's fine, I guess.  For C and C++.  But the whole structure is useless to assembler programs!
Are there typically NOT any symbol definition files for programming ARMs in assembler?  Really?

 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #33 on: September 03, 2014, 05:01:05 pm »
I intend to not just link programming/flashing tools but actually attach them here. I think the size is small enough to allow it. Does anyone know what the limit is for uploading a zip file on this forum?

You can have the in a new github project. Easier browse the file and to track modifications, and it's open to all and you can have the documentation with markdown, images, etc.
 

Offline paulieTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #34 on: September 03, 2014, 05:06:45 pm »
If you want to see real creativity in action check out some of the code repositories like google and github. Bizzare might be an understatement.
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: One Dollar One Minute ARM Development
« Reply #35 on: September 03, 2014, 06:32:37 pm »
Seems to be a currency discrimination going on ?   3 ARMs for ~13GBP ...   Thanks janekm no VAT if <15GBP , if it is Royal Mail will charge 8GBP  fee..
« Last Edit: September 03, 2014, 06:52:08 pm by 22swg »
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline paulieTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #36 on: September 03, 2014, 06:57:07 pm »
No, that's perfectly normal for Aliexpress. It's not unusual for prices to vary by a factor of 10. Even 100. Sometimes from the same seller. For example here's the first one that just came up for me without any special search terms:

http://www.aliexpress.com/item/STM32F103C8T6-STM32F103-STM32F-LQFP48-NEW-ORIGINAL-IN-STOCK/529600954.html

These guys are tricky and often depend on careless shopping. Buyer beware!

BTW anybody else notice Ebay is down?
« Last Edit: September 03, 2014, 06:58:55 pm by paulie »
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: One Dollar One Minute ARM Development
« Reply #37 on: September 03, 2014, 08:18:53 pm »
I'm thinking theres a risk of fakes or manufactures failures... where did the 48 pin boards come from please...
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline paulieTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #38 on: September 03, 2014, 08:42:08 pm »
Chinese "fakes" is an urban myth. Due to scale of mfg they would cost 1000 times more than the real thing. Parametric failures also rare. There are "refurbs" though which are highly sought after due to extremely low price and already "burned in". One lot of these f103 I was lucky to pick up for less than half dollar each. Unfortunately very seasonal. Wish I had got more then.

See first post for link to PCB. As low as 15 for a dollar (7 cents ea) with coupon. Also available on Ebay but cost a bit more.

Search is your friend with all these chinese sellers.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3233
  • Country: gb
Re: One Dollar One Minute ARM Development
« Reply #39 on: September 03, 2014, 08:58:46 pm »
Chinese "fakes" is an urban myth.

In what context, just STM32's or semiconductors in general?  If the latter then you should know that counterfeit semiconductors is a massive problem.
 

Offline paulieTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #40 on: September 03, 2014, 09:24:55 pm »
Integrated circuits in general but mainly stories about MCUs. Based on personal experience and many other sources of info from sites like Microchip forum, Circuit Cellar, DIY Drones, Avrfreaks etc. Usually just typical internet bull but also morons blaming the seller for their own incompetence. Counterfeit chips is a romantic notion but considering the sources and their credibility very unlikely. Cloned board level products on the other hand is a different story.

You are of course entitled to believe whatever you choose.
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline paulieTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #42 on: September 03, 2014, 10:04:39 pm »
I'm sure exhaustive search on the net can dig up convincing tales and statistics for virtually any argument.

Although tabloids are not my favorite source of reliable information I'm willing to consider that "Consumer Electronics/Parts" are commonly counterfeited. Specially, as I said, PCB products. There are some cases of semiconductors but mainly jellybean parts like caps, resistors, and diodes. For example chinese 1n4007 that are curiously cheaper than the lower voltage 1n4001. Turns out leads use very low gauge copper hence fail the 1 amp spec. As part of the day job I purchase several hundred thousand dollars in parts every year. In last 15 years out of a handful of claims from clients, some few traced to parametric failure but vast majority due to customer abuse.

ps. We all deserve to harbor favorite conspiracy theories and fantasies. This just don't happen to be one of mine. YMMV
« Last Edit: September 03, 2014, 10:12:23 pm by paulie »
 

Offline 22swg

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: gb
Re: One Dollar One Minute ARM Development
« Reply #43 on: September 03, 2014, 10:19:00 pm »
I recognize your obvious experience  , do you not ask yourself how come $1.30  water is dearer !   
Check your tongue, your belly and your lust. Better to enjoy someone else’s madness.
 

Offline paulieTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #44 on: September 03, 2014, 10:23:24 pm »
LOL. I'm not sure what that means but if you are referring to bottled water I never touch the stuff. In several consumer protection assays orders of magnitude higher bacterial count than what comes from the tap.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #45 on: September 04, 2014, 10:06:36 am »
Hmm.  I think your sample program needs some work before it will work on a CM3 cpu.
Code: [Select]
.thumb
.syntax unified

Does anyone know where I can find a definitive explanation of the gnu assembler syntax for ARM, specifically WRT "op2" operands and thumb2 instructions?  I found some manuals with "fill in with an explanation later", but...
 

Offline paulieTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #46 on: September 04, 2014, 04:15:15 pm »
Thanks for that. I'm sure you are a lot more experienced than me in these things and I appreciate the help. There's another bug. Without "pause" clicking on the batch file ran too fast to see so that is fixed too. "MC.BAT" has been added which removes output files similar to "make clean". New GCC zip files have been uploaded with all these corrections. I've also put up a photo of a more useful version of the DIY board in the second post (first is full). It shows the setup for flashing with the ST demo utility which I will document when I get a chance.

The ST programming manual has details on instructions and architecture features: http://code.google.com/p/cortex-ap/source/browse/trunk/Firmware/Doc/CD00228163.pdf  CD00161566.pdf is specific to f103 hardware. CD00171190 register details.

Or just search CD00171190, CD00228163, or CD00161566. I hate those Google/Github type repositories but the no nonsense links are apparently too long for this forum. I'm sure you know but for those that don't right click on "raw" to download.



Op2 is a flexible second operand that can be either a register or a constant. Compared to the 8bit world it's amazing how powerful ARM instructions are with tricks like that and the conditional feature built into most instructions. We all know assembly is not the tool for writing practical programs but I find it fascinating as a learning experience. Huge fun too IMO.
« Last Edit: September 04, 2014, 05:37:45 pm by paulie »
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #47 on: September 04, 2014, 05:39:27 pm »
Quote
I'm sure you are a lot more experienced than me
Well, no.  But it's an interesting exercise.

Quote
The ST programming manual has all the details on instructions
Except that this documents the official ARM instruction syntax, and has examples using the ARM assembler syntax, and that's NOT quite what the gnu assembler actually implements.  gas happily ignores manufacturer syntax in favor of something that is maximally "common" across the architectures that it supports, or is convenient to the C compiler, or something.  As a minor ridiculous example, the comment character in gnu as for ARM is "@" instead of ";"
I was going batty trying to figure out how to get it to accept my blink program (from the ghetto thread) which compiled fine in Keil (official) assembler.  Most of that seems to have been solved by the ".syntax unified" addition (which I'm still not sure is the correct thing for cm3/etc.)  But I still have the gnu assembler generating different code than Keil for "sub r1, r1, #1" instruction, and I don't know why :-(

Here's my contribution; I edited the CMSIS stm32f10x.h file provided by ST to make it usable by the gnu assembler.  This provide the base address of the various peripherals, and the various bit constants for registers, but it doesn't include the offsets of registers within a peripheral (which are implemented via structure definitions in the original.  Mostly, this version replaces #define with .equiv)

Edit 6-sep: new version of .asmh file; now includes GPIO peripheral offsets and better bitvalues.
2nd edit 6-sep: defines for the RCC individual registers.
3rd edit 9-sep: create some macros to allow easier conversion from C structures for ASM offset definitions, and include most of the peripheral data structures from the .h include file.
4th edit 10-sep: new version (including a sample that assembles) attached here: https://www.eevblog.com/forum/microcontrollers/one-dollar-one-minute-arm-development/msg511012/#msg511012
« Last Edit: September 11, 2014, 04:52:02 am by westfw »
 

Offline paulieTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: One Dollar One Minute ARM Development
« Reply #48 on: September 05, 2014, 01:19:59 pm »
Wow! I really appreciate the work you put into that and certainly anybody else who wants to experiment with ARM assembler will too. An update on any progress you make porting your blink to AS would also be of great interest.

I'm having problems with hex file generation. It's not obvious to me if it's as, objdump, or the linker causing trouble. Apparently the ST flash utility expects an  Extended Linear Address record and zero offset for the code which my script AS is not doing. For example the utility generates "incorrect address" errors trying to flash this version of my demo:

Code: [Select]
:08800000010080E2FEFFFFEA2F
:040000030000800079
:00000001FF

But no problem loading this version from a homebrew assembler:

Code: [Select]
:020000040800F2
:08000000010080E2FEFFFFEAAF
:040000030000800079
:00000001FF

Any hints how to get AS to assemble at zero offset instead of 8000?  I tried .org and that don't help.


 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26752
  • Country: nl
    • NCT Developments
Re: One Dollar One Minute ARM Development
« Reply #49 on: September 05, 2014, 01:55:20 pm »
You need to use a linker descriptor file otherwise LD will use some defaults. It helps to tell LD to also create a map file so you can see which code went where in the memory.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf