Studio 7 project - added files (add & add as link) not being compiled

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am intent on converting the 'Adafruit Native MP3 decoder' to the Arduino Due.

I have run into what appears to be a bug in Studio 7.

I have created the project thus:

- 'C/C++'
- 'GCC ASF board project' 
- SAM3X8E -> Arduino Due/X SAM3X8E

 

IF I add a NEW (create) .C or .S file to the project, it's added. If I add a .CPP file, it isn't added.

IF I add an existing file of ANY type from another directory, it isn't added. I have tried both 'add' and 'add as link'

The project still compiles but the files that have been added are ignored.

I note that structures defined in the non-compiling .CPP & .H files still show up in the 'Solution Explorer'.

I promise I have spent a full day trying out everything I can think of and I feel sure it's me being stupid but anyone?

 

-Not all men (and especially the wisest) share the opinion that it is bad for women to be educated. But it is very true that many foolish men have claimed this because it displeased them that women knew more than they did.-

Last Edited: Sat. May 4, 2019 - 04:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Zip up your AS7 project and attach it.   Takes two minutes from your life.

 

If a reader is inclined,  it takes two minutes from her life to load your AS7.0 project.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I do beg your pardon - I honestly didn't know that was the done thing. MY project is nothing much, just Studio 7's Arduino Due project, it's adding the Adafruit MP3 files to it (enclosed) that is causing the problem. I DID test projects built for other targets and ran into exactly the same problem - not being able to add existing files to the project.
 

I've zipped up the project folder (Due) & the directory containing the files I wish to add (Adafruit_MP3-master) within a single folder.

Thank you for your time.

Attachment(s): 

-Not all men (and especially the wisest) share the opinion that it is bad for women to be educated. But it is very true that many foolish men have claimed this because it displeased them that women knew more than they did.-

Last Edited: Mon. May 6, 2019 - 12:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As far as I can see,  the Adafruit_mp3 does not support the SAM3X.

It seems to have conditional code for SAMD51, MK66, MK20 cpus.

 

I suggest that you buy the appropriate target board.   Run test and develop.

 

When familiar with the library,  you can Fork it and port to the Due.

I know nothing about MP3.   You will learn.   Especially about any hardware acceleration required.   The SAM3X may or may not be capable.

 

I strongly recommend  that you stick with the Arduino IDE.   At least to gain experience with the library examples.

 

When you have a working Arduino SAMD51 project,  you can attempt to "import" into AS7.0

 

Teensy users will probably be more enthusiastic than Metro/Feather owners but this means NXP/Kinetis chips.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your response. I intend to add SAM3X support to the project. The Helix decoder is an optimized fixed-point implementation & their is actually some design elements tailored to make it efficient on ARM cores without MMEs (it was written before the M4 was announced). I spent about 3 months reading the various technical papers on MP3 decoders ('Audio on the Cortex M' by D. Pradeep seems the best) and they all concluded that the FDCT & Polyphase Filterbank, combined, take around half (40-47% from 11 estimates) of the total processing time. With that in mind, I rewrote the FDCT32 (dct32.cpp) & Polyphasestereo (polyphase.cpp) routines in optimized assembly language to work out if there was any point in proceeding. The M4 averages out about 20% faster. While I don't think an 84MHz Cortex M3 is going to manage all the bit-rates, I believe it's capable of managing useful ones. I spent 20 years as a professional computer games programmer but the only language I've ever mastered is assembly language(s?).
 

In the mean-time, I've still been reading every document I can find but nothing goes into more detail CC adding files to projects; it LOOKS simple. I DID notice that properties of the files I added to the project had the 'Build Action' set to 'None' so I switched them to 'Compile' but they are still not being compiled. I notice that their is a line above 'Build Action' (when viewed in 'catagorized' order) that has no description in the left column (and no description is brought up when I click on it) but is set to 'false' in the files created by Studio 7 but is set to 'true' for the files I have added. I cannot change this flag.
 

I searched of images of the 'File Properties' window of Studio 7 to see what this unexplained true/false flag is and here is where it gets more confusing:
 

https://www.avrfreaks.net/forum/...
 

So in that chap's version of S7, that line is the file size which seems logical.

So I'm asking myself why am I seeing an undefined true/false flag and why is said flag set to 'false' on the files created by S7 but set to 'true' on files & add? Could someone please just check if they are seeing this mysterious flag in my project, please?

-Not all men (and especially the wisest) share the opinion that it is bad for women to be educated. But it is very true that many foolish men have claimed this because it displeased them that women knew more than they did.-

Last Edited: Tue. May 7, 2019 - 04:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I suggest that you buy a Teensy3.x or Feather M4.

Unless you value your life at $0.50 per hour.

 

Fork the Adafruit_MP3 library.   Create a SAM3X branch.

I suspect that the conditional M4 code is easy to spot.   And relatively easy to re-write for M3.

 

Have you looked at STM32F103?   Punters are even more obsessed with using legacy STM32F103 than SAM3XE.

 

The subject does not interest me.   But I bet that someone has done it for M3.   Might even have tried M0 !!

 

If you ask Adafruit nicely,  they will probably give you the SAMD51 hardware.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 I totally appreciate your logic David. The thing is, the M3 decoder is actually a stepping stone to an M0 decoder. The latter only has to support a 64 kbs mono stream for speech but it's for a proposed '1000 books' charity project for the Indian Department of School,  Education and Literacy. Bunnie (Andrew Huang) first alerted me to the fact that the modified 8051s used to control SD cards are being displaced by Cortex M0+ based SoCs (64 MHz ones at that), especially in Micro SDs because they use less power. Joseph Yiu (my friend at ARM - you may have some of his books) opined that it was possible but that it's going to have to be 100% optimized. Thus getting the thing running on the Due means I can rewrite each routine in Thumb 1 at a time and debug them.

 Cheap SD memory sold to industry is <8¢/Gb in bulk. Between Bunnie's team & the ARM team in Bengaluru, it will be interesting to see just how cheap they can make such a device. Audible format 3 is a 64 kbs mono MP3 stream so we know the quality is good in many languages and one of the papers I have noted that speech only uses around 10 of the 32 frequency domains while music uses around 20 so that makes things simpler. You may have noted that the Helix player does use the radix 4/8 DCT (for example) so it's a good place to start - 7 years of development makes it a mature produce.

I've contacted the tech-support for Atmel because clearly the IDE is doing something strange. I do find it amusing that the bug may well be displaying the very switch that is the problem.

Regards,
Sean

-Not all men (and especially the wisest) share the opinion that it is bad for women to be educated. But it is very true that many foolish men have claimed this because it displeased them that women knew more than they did.-

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Whether you want to implement on M3, M0, 8051, AVR, ... it still seems wise to start with a working solution e.g. Adafruit_MP3 on Cortex-M4 target.

 

If you are an expert with ARM assembly language you can probably improve on the M4.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 I'm writing the thing in Thumb. The Thumb 2 version will be almost entirely different. Don't forget, MULSHIFT32 & MADD64 are the 2 key maths functions MP3 (look at the code to see how common) uses so having to do them in software means R0-R4 are corrupted thus the code has to be written around that. As soon as you have 64-bit maths instructions, you approach the thing in a totally different manner.

 I've converted whole (finished) games on 1 platform and just converted the whole thing in one go so it isn't new to me. Since almost every ARM design since 1995 has supported (Tv4) Thumb, a decoder written in Thumb will work on more CPUs than any other solution. Thumb 2, DSP, NEON, FP & interworking with full 32-bit ARM may all be required to optimize for the various different processors but as long as ALL of them can manage a 64 kbs mono stream (using a 48 KHz output) then the primary utility goal is met. 

-Not all men (and especially the wisest) share the opinion that it is bad for women to be educated. But it is very true that many foolish men have claimed this because it displeased them that women knew more than they did.-