Serial.print text strings go into SRAM or flash?

Let's say I have a line of code like this:

Serial.print("Hello\n");

That string uses 6 bytes of memory and should go into the program memory since the string is a constant and does not change. Is this correct?

It goes In both, but ends up in RAM.

(It use seven bytes, BTW)

7 bytes, right. But why does it go into RAM? What's an easy way to make it not go into ram?
Do I have to define the string somewhere else in a special form and then pass that variable to print?
I really don't want to do that, it would be quite time intensive.

I may also have a solution that I just found, in case someone else has the same issue. Enclose the string with F(), as seen on this page: Optimizing SRAM | Memories of an Arduino | Adafruit Learning System

Still, why the heck does it go into RAM. I was not used to this so I checked another tool chain to see if I was going crazy. I tried MPLAB X IDE (microchip) and the string only went into program memory. It's a constant string, so this only makes sense. I don't understand what the issue is with arduino.

The F() macro is the way to ensure it doesn't end up in RAM.

Still, why the heck does it go into RAM.

Because a char pointer terms is a char pointer whether it points to RAM or flash, but the address spaces are entirely separate and require different instructions to access them.

Unless you explicitly put them in progmem, they're stored in ram; this is a harvard architecture machine, with separate data and program memories.

You want to use the F() macro (just put the string inside of F(), like serial.print(F("Hello\n"));

I see, so even a stupid PIC is superior to the arduino. DrAzzy, you have perfectly answered my question. The last thing I will say is that in my 5 years of embedded development I have never had so many problems with a microcontroller than the arduino. my hands are tied and i have to use it for now.
Some of the issues were so ridiculous, people probably wouldn't believe me if i told them. I give you one of many examples, one time I couldn't program a device because one of my text strings had 3 exclamation marks in it. Ridiculous I say lol!

I have never had so many problems with a microcontroller than the arduino.

That's microcontroller spelled "AVR", not "Arduino".

Ridiculous I say

Under-informed, I say. Your problem with the exclamation marks is a problem with an item of software, namely a boot loader, not the device. Even after only five years of working in embedded systems, I would have hoped you would know the difference.

I see, so even a stupid PIC is superior to the arduino.

Do you know what "non sequitur" means?

pgib8:
I see, so even a stupid PIC is superior to the arduino.

I fail to see how "requiring the programmer to use it correctly" makes AVR inferior. Are you familiar with the differences between harvard architecture vs a von neumann architecture? The separate program memory really does have advantages....

To be fair, the AVR and PIC are both Harvard, though the 16 series PICs can't even manage a simple RAM look up table (probably because of the nasty banked RAM architecture)

Look, I know that arduino is AVR based. I'm used to dedicated programmers, like j-link. When I refer to the device as the arduino, I really mean AVR with the bootloader and built on a development board that follows a certain schematic. As a whole, I call it arduino, get it?
If I complain about the !!! in the text string, I understand it is due to either the IDE, USB chip, or boot loader. I really don't care what causes it. All I see is a device, excuse me, circuit board, that has ARDUINO written on it, and that can't be programmed because of 3 exclamation marks. So I don't think I'm too far off my base when I say i couldn't program the arduino because of it.
So you want to defend AVR over PIC. I really don't care. Look at the top of your browser. It says arduino.cc; and that's what I'm talking about. I meant what I said with "even a stupid PIC is superior to the arduino". To me many PICs have been the lowest class of microcontrollers. Everything that falls below that is what I would consider toys for kids and I definitely place the arduino right there. I'm guessing you love arduinos because you can make blinky lights without ever having to look at a datasheet, good for you, carry on; and I'm done arguing, got work to do.

I smell troll.

All I see is a device, excuse me, circuit board, that has ARDUINO written on it, and that can't be programmed because of 3 exclamation marks.

"can't be programmed" ?
Do you truly believe that, Mr "I've-got-a-J-Link"?

Look at the top of your browser. It says arduino.cc; and that's what I'm talking about.

So now you're having difficulties distinguishing a dev board, from a micro controller, from a website?
Man, you've got issues.

I'm guessing you love arduinos because you can make blinky lights without ever having to look at a datasheet,

No, I love it because it allows people with even less experience than you to make blinky lights, move servos, bleep etc etc, without even knowing what a data sheet looks like.

I'm guessing you love arduinos because you can make blinky lights without ever having to look at a datasheet, good for you, carry on; and I'm done arguing, got work to do.

Oooo..., did the little arduino pee in your cornflakes? :sunglasses: